
obj/user/testbss.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 af 00 00 00       	call   8000e0 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:

uint32_t bigarray[ARRAYSIZE];

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	83 ec 14             	sub    $0x14,%esp
	int i;

	cprintf("Making sure bss works right...\n");
  80003d:	68 60 1f 80 00       	push   $0x801f60
  800042:	e8 f2 01 00 00       	call   800239 <cprintf>
  800047:	83 c4 10             	add    $0x10,%esp
	for (i = 0; i < ARRAYSIZE; i++)
  80004a:	b8 00 00 00 00       	mov    $0x0,%eax
		if (bigarray[i] != 0)
  80004f:	83 3c 85 20 40 80 00 	cmpl   $0x0,0x804020(,%eax,4)
  800056:	00 
  800057:	75 63                	jne    8000bc <umain+0x89>
	for (i = 0; i < ARRAYSIZE; i++)
  800059:	83 c0 01             	add    $0x1,%eax
  80005c:	3d 00 00 10 00       	cmp    $0x100000,%eax
  800061:	75 ec                	jne    80004f <umain+0x1c>
			panic("bigarray[%d] isn't cleared!\n", i);
	for (i = 0; i < ARRAYSIZE; i++)
  800063:	b8 00 00 00 00       	mov    $0x0,%eax
		bigarray[i] = i;
  800068:	89 04 85 20 40 80 00 	mov    %eax,0x804020(,%eax,4)
	for (i = 0; i < ARRAYSIZE; i++)
  80006f:	83 c0 01             	add    $0x1,%eax
  800072:	3d 00 00 10 00       	cmp    $0x100000,%eax
  800077:	75 ef                	jne    800068 <umain+0x35>
	for (i = 0; i < ARRAYSIZE; i++)
  800079:	b8 00 00 00 00       	mov    $0x0,%eax
		if (bigarray[i] != i)
  80007e:	39 04 85 20 40 80 00 	cmp    %eax,0x804020(,%eax,4)
  800085:	75 47                	jne    8000ce <umain+0x9b>
	for (i = 0; i < ARRAYSIZE; i++)
  800087:	83 c0 01             	add    $0x1,%eax
  80008a:	3d 00 00 10 00       	cmp    $0x100000,%eax
  80008f:	75 ed                	jne    80007e <umain+0x4b>
			panic("bigarray[%d] didn't hold its value!\n", i);

	cprintf("Yes, good.  Now doing a wild write off the end...\n");
  800091:	83 ec 0c             	sub    $0xc,%esp
  800094:	68 a8 1f 80 00       	push   $0x801fa8
  800099:	e8 9b 01 00 00       	call   800239 <cprintf>
	bigarray[ARRAYSIZE+1024] = 0;
  80009e:	c7 05 20 50 c0 00 00 	movl   $0x0,0xc05020
  8000a5:	00 00 00 
	panic("SHOULD HAVE TRAPPED!!!");
  8000a8:	83 c4 0c             	add    $0xc,%esp
  8000ab:	68 07 20 80 00       	push   $0x802007
  8000b0:	6a 1a                	push   $0x1a
  8000b2:	68 f8 1f 80 00       	push   $0x801ff8
  8000b7:	e8 96 00 00 00       	call   800152 <_panic>
			panic("bigarray[%d] isn't cleared!\n", i);
  8000bc:	50                   	push   %eax
  8000bd:	68 db 1f 80 00       	push   $0x801fdb
  8000c2:	6a 11                	push   $0x11
  8000c4:	68 f8 1f 80 00       	push   $0x801ff8
  8000c9:	e8 84 00 00 00       	call   800152 <_panic>
			panic("bigarray[%d] didn't hold its value!\n", i);
  8000ce:	50                   	push   %eax
  8000cf:	68 80 1f 80 00       	push   $0x801f80
  8000d4:	6a 16                	push   $0x16
  8000d6:	68 f8 1f 80 00       	push   $0x801ff8
  8000db:	e8 72 00 00 00       	call   800152 <_panic>

008000e0 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  8000e0:	f3 0f 1e fb          	endbr32 
  8000e4:	55                   	push   %ebp
  8000e5:	89 e5                	mov    %esp,%ebp
  8000e7:	56                   	push   %esi
  8000e8:	53                   	push   %ebx
  8000e9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  8000ec:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  8000ef:	c7 05 20 40 c0 00 00 	movl   $0x0,0xc04020
  8000f6:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  8000f9:	e8 10 0b 00 00       	call   800c0e <sys_getenvid>
  8000fe:	25 ff 03 00 00       	and    $0x3ff,%eax
  800103:	6b c0 7c             	imul   $0x7c,%eax,%eax
  800106:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  80010b:	a3 20 40 c0 00       	mov    %eax,0xc04020

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800110:	85 db                	test   %ebx,%ebx
  800112:	7e 07                	jle    80011b <libmain+0x3b>
		binaryname = argv[0];
  800114:	8b 06                	mov    (%esi),%eax
  800116:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  80011b:	83 ec 08             	sub    $0x8,%esp
  80011e:	56                   	push   %esi
  80011f:	53                   	push   %ebx
  800120:	e8 0e ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  800125:	e8 0a 00 00 00       	call   800134 <exit>
}
  80012a:	83 c4 10             	add    $0x10,%esp
  80012d:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800130:	5b                   	pop    %ebx
  800131:	5e                   	pop    %esi
  800132:	5d                   	pop    %ebp
  800133:	c3                   	ret    

00800134 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  800134:	f3 0f 1e fb          	endbr32 
  800138:	55                   	push   %ebp
  800139:	89 e5                	mov    %esp,%ebp
  80013b:	83 ec 08             	sub    $0x8,%esp
	close_all();
  80013e:	e8 11 0f 00 00       	call   801054 <close_all>
	sys_env_destroy(0);
  800143:	83 ec 0c             	sub    $0xc,%esp
  800146:	6a 00                	push   $0x0
  800148:	e8 7c 0a 00 00       	call   800bc9 <sys_env_destroy>
}
  80014d:	83 c4 10             	add    $0x10,%esp
  800150:	c9                   	leave  
  800151:	c3                   	ret    

00800152 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  800152:	f3 0f 1e fb          	endbr32 
  800156:	55                   	push   %ebp
  800157:	89 e5                	mov    %esp,%ebp
  800159:	56                   	push   %esi
  80015a:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  80015b:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  80015e:	8b 35 00 30 80 00    	mov    0x803000,%esi
  800164:	e8 a5 0a 00 00       	call   800c0e <sys_getenvid>
  800169:	83 ec 0c             	sub    $0xc,%esp
  80016c:	ff 75 0c             	pushl  0xc(%ebp)
  80016f:	ff 75 08             	pushl  0x8(%ebp)
  800172:	56                   	push   %esi
  800173:	50                   	push   %eax
  800174:	68 28 20 80 00       	push   $0x802028
  800179:	e8 bb 00 00 00       	call   800239 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  80017e:	83 c4 18             	add    $0x18,%esp
  800181:	53                   	push   %ebx
  800182:	ff 75 10             	pushl  0x10(%ebp)
  800185:	e8 5a 00 00 00       	call   8001e4 <vcprintf>
	cprintf("\n");
  80018a:	c7 04 24 f6 1f 80 00 	movl   $0x801ff6,(%esp)
  800191:	e8 a3 00 00 00       	call   800239 <cprintf>
  800196:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  800199:	cc                   	int3   
  80019a:	eb fd                	jmp    800199 <_panic+0x47>

0080019c <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  80019c:	f3 0f 1e fb          	endbr32 
  8001a0:	55                   	push   %ebp
  8001a1:	89 e5                	mov    %esp,%ebp
  8001a3:	53                   	push   %ebx
  8001a4:	83 ec 04             	sub    $0x4,%esp
  8001a7:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  8001aa:	8b 13                	mov    (%ebx),%edx
  8001ac:	8d 42 01             	lea    0x1(%edx),%eax
  8001af:	89 03                	mov    %eax,(%ebx)
  8001b1:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8001b4:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  8001b8:	3d ff 00 00 00       	cmp    $0xff,%eax
  8001bd:	74 09                	je     8001c8 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  8001bf:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  8001c3:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8001c6:	c9                   	leave  
  8001c7:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  8001c8:	83 ec 08             	sub    $0x8,%esp
  8001cb:	68 ff 00 00 00       	push   $0xff
  8001d0:	8d 43 08             	lea    0x8(%ebx),%eax
  8001d3:	50                   	push   %eax
  8001d4:	e8 ab 09 00 00       	call   800b84 <sys_cputs>
		b->idx = 0;
  8001d9:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  8001df:	83 c4 10             	add    $0x10,%esp
  8001e2:	eb db                	jmp    8001bf <putch+0x23>

008001e4 <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  8001e4:	f3 0f 1e fb          	endbr32 
  8001e8:	55                   	push   %ebp
  8001e9:	89 e5                	mov    %esp,%ebp
  8001eb:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  8001f1:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  8001f8:	00 00 00 
	b.cnt = 0;
  8001fb:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  800202:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  800205:	ff 75 0c             	pushl  0xc(%ebp)
  800208:	ff 75 08             	pushl  0x8(%ebp)
  80020b:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  800211:	50                   	push   %eax
  800212:	68 9c 01 80 00       	push   $0x80019c
  800217:	e8 20 01 00 00       	call   80033c <vprintfmt>
	sys_cputs(b.buf, b.idx);
  80021c:	83 c4 08             	add    $0x8,%esp
  80021f:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  800225:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  80022b:	50                   	push   %eax
  80022c:	e8 53 09 00 00       	call   800b84 <sys_cputs>

	return b.cnt;
}
  800231:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  800237:	c9                   	leave  
  800238:	c3                   	ret    

00800239 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800239:	f3 0f 1e fb          	endbr32 
  80023d:	55                   	push   %ebp
  80023e:	89 e5                	mov    %esp,%ebp
  800240:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  800243:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  800246:	50                   	push   %eax
  800247:	ff 75 08             	pushl  0x8(%ebp)
  80024a:	e8 95 ff ff ff       	call   8001e4 <vcprintf>
	va_end(ap);

	return cnt;
}
  80024f:	c9                   	leave  
  800250:	c3                   	ret    

00800251 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  800251:	55                   	push   %ebp
  800252:	89 e5                	mov    %esp,%ebp
  800254:	57                   	push   %edi
  800255:	56                   	push   %esi
  800256:	53                   	push   %ebx
  800257:	83 ec 1c             	sub    $0x1c,%esp
  80025a:	89 c7                	mov    %eax,%edi
  80025c:	89 d6                	mov    %edx,%esi
  80025e:	8b 45 08             	mov    0x8(%ebp),%eax
  800261:	8b 55 0c             	mov    0xc(%ebp),%edx
  800264:	89 d1                	mov    %edx,%ecx
  800266:	89 c2                	mov    %eax,%edx
  800268:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80026b:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  80026e:	8b 45 10             	mov    0x10(%ebp),%eax
  800271:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  800274:	89 45 e0             	mov    %eax,-0x20(%ebp)
  800277:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  80027e:	39 c2                	cmp    %eax,%edx
  800280:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  800283:	72 3e                	jb     8002c3 <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  800285:	83 ec 0c             	sub    $0xc,%esp
  800288:	ff 75 18             	pushl  0x18(%ebp)
  80028b:	83 eb 01             	sub    $0x1,%ebx
  80028e:	53                   	push   %ebx
  80028f:	50                   	push   %eax
  800290:	83 ec 08             	sub    $0x8,%esp
  800293:	ff 75 e4             	pushl  -0x1c(%ebp)
  800296:	ff 75 e0             	pushl  -0x20(%ebp)
  800299:	ff 75 dc             	pushl  -0x24(%ebp)
  80029c:	ff 75 d8             	pushl  -0x28(%ebp)
  80029f:	e8 5c 1a 00 00       	call   801d00 <__udivdi3>
  8002a4:	83 c4 18             	add    $0x18,%esp
  8002a7:	52                   	push   %edx
  8002a8:	50                   	push   %eax
  8002a9:	89 f2                	mov    %esi,%edx
  8002ab:	89 f8                	mov    %edi,%eax
  8002ad:	e8 9f ff ff ff       	call   800251 <printnum>
  8002b2:	83 c4 20             	add    $0x20,%esp
  8002b5:	eb 13                	jmp    8002ca <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  8002b7:	83 ec 08             	sub    $0x8,%esp
  8002ba:	56                   	push   %esi
  8002bb:	ff 75 18             	pushl  0x18(%ebp)
  8002be:	ff d7                	call   *%edi
  8002c0:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  8002c3:	83 eb 01             	sub    $0x1,%ebx
  8002c6:	85 db                	test   %ebx,%ebx
  8002c8:	7f ed                	jg     8002b7 <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  8002ca:	83 ec 08             	sub    $0x8,%esp
  8002cd:	56                   	push   %esi
  8002ce:	83 ec 04             	sub    $0x4,%esp
  8002d1:	ff 75 e4             	pushl  -0x1c(%ebp)
  8002d4:	ff 75 e0             	pushl  -0x20(%ebp)
  8002d7:	ff 75 dc             	pushl  -0x24(%ebp)
  8002da:	ff 75 d8             	pushl  -0x28(%ebp)
  8002dd:	e8 2e 1b 00 00       	call   801e10 <__umoddi3>
  8002e2:	83 c4 14             	add    $0x14,%esp
  8002e5:	0f be 80 4b 20 80 00 	movsbl 0x80204b(%eax),%eax
  8002ec:	50                   	push   %eax
  8002ed:	ff d7                	call   *%edi
}
  8002ef:	83 c4 10             	add    $0x10,%esp
  8002f2:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8002f5:	5b                   	pop    %ebx
  8002f6:	5e                   	pop    %esi
  8002f7:	5f                   	pop    %edi
  8002f8:	5d                   	pop    %ebp
  8002f9:	c3                   	ret    

008002fa <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  8002fa:	f3 0f 1e fb          	endbr32 
  8002fe:	55                   	push   %ebp
  8002ff:	89 e5                	mov    %esp,%ebp
  800301:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  800304:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800308:	8b 10                	mov    (%eax),%edx
  80030a:	3b 50 04             	cmp    0x4(%eax),%edx
  80030d:	73 0a                	jae    800319 <sprintputch+0x1f>
		*b->buf++ = ch;
  80030f:	8d 4a 01             	lea    0x1(%edx),%ecx
  800312:	89 08                	mov    %ecx,(%eax)
  800314:	8b 45 08             	mov    0x8(%ebp),%eax
  800317:	88 02                	mov    %al,(%edx)
}
  800319:	5d                   	pop    %ebp
  80031a:	c3                   	ret    

0080031b <printfmt>:
{
  80031b:	f3 0f 1e fb          	endbr32 
  80031f:	55                   	push   %ebp
  800320:	89 e5                	mov    %esp,%ebp
  800322:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  800325:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  800328:	50                   	push   %eax
  800329:	ff 75 10             	pushl  0x10(%ebp)
  80032c:	ff 75 0c             	pushl  0xc(%ebp)
  80032f:	ff 75 08             	pushl  0x8(%ebp)
  800332:	e8 05 00 00 00       	call   80033c <vprintfmt>
}
  800337:	83 c4 10             	add    $0x10,%esp
  80033a:	c9                   	leave  
  80033b:	c3                   	ret    

0080033c <vprintfmt>:
{
  80033c:	f3 0f 1e fb          	endbr32 
  800340:	55                   	push   %ebp
  800341:	89 e5                	mov    %esp,%ebp
  800343:	57                   	push   %edi
  800344:	56                   	push   %esi
  800345:	53                   	push   %ebx
  800346:	83 ec 3c             	sub    $0x3c,%esp
  800349:	8b 75 08             	mov    0x8(%ebp),%esi
  80034c:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  80034f:	8b 7d 10             	mov    0x10(%ebp),%edi
  800352:	e9 5d 03 00 00       	jmp    8006b4 <vprintfmt+0x378>
		padc = ' ';
  800357:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  80035b:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  800362:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  800369:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  800370:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  800375:	8d 47 01             	lea    0x1(%edi),%eax
  800378:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80037b:	0f b6 17             	movzbl (%edi),%edx
  80037e:	8d 42 dd             	lea    -0x23(%edx),%eax
  800381:	3c 55                	cmp    $0x55,%al
  800383:	0f 87 ae 03 00 00    	ja     800737 <vprintfmt+0x3fb>
  800389:	0f b6 c0             	movzbl %al,%eax
  80038c:	3e ff 24 85 80 21 80 	notrack jmp *0x802180(,%eax,4)
  800393:	00 
  800394:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  800397:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  80039b:	eb d8                	jmp    800375 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  80039d:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  8003a0:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  8003a4:	eb cf                	jmp    800375 <vprintfmt+0x39>
  8003a6:	0f b6 d2             	movzbl %dl,%edx
  8003a9:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  8003ac:	b8 00 00 00 00       	mov    $0x0,%eax
  8003b1:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  8003b4:	8d 04 80             	lea    (%eax,%eax,4),%eax
  8003b7:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  8003bb:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  8003be:	8d 4a d0             	lea    -0x30(%edx),%ecx
  8003c1:	83 f9 09             	cmp    $0x9,%ecx
  8003c4:	77 55                	ja     80041b <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  8003c6:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  8003c9:	eb e9                	jmp    8003b4 <vprintfmt+0x78>
			precision = va_arg(ap, int);
  8003cb:	8b 45 14             	mov    0x14(%ebp),%eax
  8003ce:	8b 00                	mov    (%eax),%eax
  8003d0:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8003d3:	8b 45 14             	mov    0x14(%ebp),%eax
  8003d6:	8d 40 04             	lea    0x4(%eax),%eax
  8003d9:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8003dc:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  8003df:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8003e3:	79 90                	jns    800375 <vprintfmt+0x39>
				width = precision, precision = -1;
  8003e5:	8b 45 d8             	mov    -0x28(%ebp),%eax
  8003e8:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8003eb:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  8003f2:	eb 81                	jmp    800375 <vprintfmt+0x39>
  8003f4:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  8003f7:	85 c0                	test   %eax,%eax
  8003f9:	ba 00 00 00 00       	mov    $0x0,%edx
  8003fe:	0f 49 d0             	cmovns %eax,%edx
  800401:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800404:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800407:	e9 69 ff ff ff       	jmp    800375 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  80040c:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  80040f:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  800416:	e9 5a ff ff ff       	jmp    800375 <vprintfmt+0x39>
  80041b:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  80041e:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800421:	eb bc                	jmp    8003df <vprintfmt+0xa3>
			lflag++;
  800423:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  800426:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800429:	e9 47 ff ff ff       	jmp    800375 <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  80042e:	8b 45 14             	mov    0x14(%ebp),%eax
  800431:	8d 78 04             	lea    0x4(%eax),%edi
  800434:	83 ec 08             	sub    $0x8,%esp
  800437:	53                   	push   %ebx
  800438:	ff 30                	pushl  (%eax)
  80043a:	ff d6                	call   *%esi
			break;
  80043c:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  80043f:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  800442:	e9 6a 02 00 00       	jmp    8006b1 <vprintfmt+0x375>
			err = va_arg(ap, int);
  800447:	8b 45 14             	mov    0x14(%ebp),%eax
  80044a:	8d 78 04             	lea    0x4(%eax),%edi
  80044d:	8b 00                	mov    (%eax),%eax
  80044f:	99                   	cltd   
  800450:	31 d0                	xor    %edx,%eax
  800452:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  800454:	83 f8 0f             	cmp    $0xf,%eax
  800457:	7f 23                	jg     80047c <vprintfmt+0x140>
  800459:	8b 14 85 e0 22 80 00 	mov    0x8022e0(,%eax,4),%edx
  800460:	85 d2                	test   %edx,%edx
  800462:	74 18                	je     80047c <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  800464:	52                   	push   %edx
  800465:	68 11 24 80 00       	push   $0x802411
  80046a:	53                   	push   %ebx
  80046b:	56                   	push   %esi
  80046c:	e8 aa fe ff ff       	call   80031b <printfmt>
  800471:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  800474:	89 7d 14             	mov    %edi,0x14(%ebp)
  800477:	e9 35 02 00 00       	jmp    8006b1 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  80047c:	50                   	push   %eax
  80047d:	68 63 20 80 00       	push   $0x802063
  800482:	53                   	push   %ebx
  800483:	56                   	push   %esi
  800484:	e8 92 fe ff ff       	call   80031b <printfmt>
  800489:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  80048c:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  80048f:	e9 1d 02 00 00       	jmp    8006b1 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  800494:	8b 45 14             	mov    0x14(%ebp),%eax
  800497:	83 c0 04             	add    $0x4,%eax
  80049a:	89 45 c8             	mov    %eax,-0x38(%ebp)
  80049d:	8b 45 14             	mov    0x14(%ebp),%eax
  8004a0:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  8004a2:	85 d2                	test   %edx,%edx
  8004a4:	b8 5c 20 80 00       	mov    $0x80205c,%eax
  8004a9:	0f 45 c2             	cmovne %edx,%eax
  8004ac:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  8004af:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8004b3:	7e 06                	jle    8004bb <vprintfmt+0x17f>
  8004b5:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  8004b9:	75 0d                	jne    8004c8 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  8004bb:	8b 45 cc             	mov    -0x34(%ebp),%eax
  8004be:	89 c7                	mov    %eax,%edi
  8004c0:	03 45 d4             	add    -0x2c(%ebp),%eax
  8004c3:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8004c6:	eb 55                	jmp    80051d <vprintfmt+0x1e1>
  8004c8:	83 ec 08             	sub    $0x8,%esp
  8004cb:	ff 75 d8             	pushl  -0x28(%ebp)
  8004ce:	ff 75 cc             	pushl  -0x34(%ebp)
  8004d1:	e8 15 03 00 00       	call   8007eb <strnlen>
  8004d6:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  8004d9:	29 c2                	sub    %eax,%edx
  8004db:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  8004de:	83 c4 10             	add    $0x10,%esp
  8004e1:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  8004e3:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  8004e7:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  8004ea:	85 ff                	test   %edi,%edi
  8004ec:	7e 11                	jle    8004ff <vprintfmt+0x1c3>
					putch(padc, putdat);
  8004ee:	83 ec 08             	sub    $0x8,%esp
  8004f1:	53                   	push   %ebx
  8004f2:	ff 75 d4             	pushl  -0x2c(%ebp)
  8004f5:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  8004f7:	83 ef 01             	sub    $0x1,%edi
  8004fa:	83 c4 10             	add    $0x10,%esp
  8004fd:	eb eb                	jmp    8004ea <vprintfmt+0x1ae>
  8004ff:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  800502:	85 d2                	test   %edx,%edx
  800504:	b8 00 00 00 00       	mov    $0x0,%eax
  800509:	0f 49 c2             	cmovns %edx,%eax
  80050c:	29 c2                	sub    %eax,%edx
  80050e:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  800511:	eb a8                	jmp    8004bb <vprintfmt+0x17f>
					putch(ch, putdat);
  800513:	83 ec 08             	sub    $0x8,%esp
  800516:	53                   	push   %ebx
  800517:	52                   	push   %edx
  800518:	ff d6                	call   *%esi
  80051a:	83 c4 10             	add    $0x10,%esp
  80051d:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800520:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  800522:	83 c7 01             	add    $0x1,%edi
  800525:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800529:	0f be d0             	movsbl %al,%edx
  80052c:	85 d2                	test   %edx,%edx
  80052e:	74 4b                	je     80057b <vprintfmt+0x23f>
  800530:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  800534:	78 06                	js     80053c <vprintfmt+0x200>
  800536:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  80053a:	78 1e                	js     80055a <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  80053c:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  800540:	74 d1                	je     800513 <vprintfmt+0x1d7>
  800542:	0f be c0             	movsbl %al,%eax
  800545:	83 e8 20             	sub    $0x20,%eax
  800548:	83 f8 5e             	cmp    $0x5e,%eax
  80054b:	76 c6                	jbe    800513 <vprintfmt+0x1d7>
					putch('?', putdat);
  80054d:	83 ec 08             	sub    $0x8,%esp
  800550:	53                   	push   %ebx
  800551:	6a 3f                	push   $0x3f
  800553:	ff d6                	call   *%esi
  800555:	83 c4 10             	add    $0x10,%esp
  800558:	eb c3                	jmp    80051d <vprintfmt+0x1e1>
  80055a:	89 cf                	mov    %ecx,%edi
  80055c:	eb 0e                	jmp    80056c <vprintfmt+0x230>
				putch(' ', putdat);
  80055e:	83 ec 08             	sub    $0x8,%esp
  800561:	53                   	push   %ebx
  800562:	6a 20                	push   $0x20
  800564:	ff d6                	call   *%esi
			for (; width > 0; width--)
  800566:	83 ef 01             	sub    $0x1,%edi
  800569:	83 c4 10             	add    $0x10,%esp
  80056c:	85 ff                	test   %edi,%edi
  80056e:	7f ee                	jg     80055e <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  800570:	8b 45 c8             	mov    -0x38(%ebp),%eax
  800573:	89 45 14             	mov    %eax,0x14(%ebp)
  800576:	e9 36 01 00 00       	jmp    8006b1 <vprintfmt+0x375>
  80057b:	89 cf                	mov    %ecx,%edi
  80057d:	eb ed                	jmp    80056c <vprintfmt+0x230>
	if (lflag >= 2)
  80057f:	83 f9 01             	cmp    $0x1,%ecx
  800582:	7f 1f                	jg     8005a3 <vprintfmt+0x267>
	else if (lflag)
  800584:	85 c9                	test   %ecx,%ecx
  800586:	74 67                	je     8005ef <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  800588:	8b 45 14             	mov    0x14(%ebp),%eax
  80058b:	8b 00                	mov    (%eax),%eax
  80058d:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800590:	89 c1                	mov    %eax,%ecx
  800592:	c1 f9 1f             	sar    $0x1f,%ecx
  800595:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800598:	8b 45 14             	mov    0x14(%ebp),%eax
  80059b:	8d 40 04             	lea    0x4(%eax),%eax
  80059e:	89 45 14             	mov    %eax,0x14(%ebp)
  8005a1:	eb 17                	jmp    8005ba <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  8005a3:	8b 45 14             	mov    0x14(%ebp),%eax
  8005a6:	8b 50 04             	mov    0x4(%eax),%edx
  8005a9:	8b 00                	mov    (%eax),%eax
  8005ab:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8005ae:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8005b1:	8b 45 14             	mov    0x14(%ebp),%eax
  8005b4:	8d 40 08             	lea    0x8(%eax),%eax
  8005b7:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  8005ba:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8005bd:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  8005c0:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  8005c5:	85 c9                	test   %ecx,%ecx
  8005c7:	0f 89 ca 00 00 00    	jns    800697 <vprintfmt+0x35b>
				putch('-', putdat);
  8005cd:	83 ec 08             	sub    $0x8,%esp
  8005d0:	53                   	push   %ebx
  8005d1:	6a 2d                	push   $0x2d
  8005d3:	ff d6                	call   *%esi
				num = -(long long) num;
  8005d5:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8005d8:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  8005db:	f7 da                	neg    %edx
  8005dd:	83 d1 00             	adc    $0x0,%ecx
  8005e0:	f7 d9                	neg    %ecx
  8005e2:	83 c4 10             	add    $0x10,%esp
			base = 10;
  8005e5:	b8 0a 00 00 00       	mov    $0xa,%eax
  8005ea:	e9 a8 00 00 00       	jmp    800697 <vprintfmt+0x35b>
		return va_arg(*ap, int);
  8005ef:	8b 45 14             	mov    0x14(%ebp),%eax
  8005f2:	8b 00                	mov    (%eax),%eax
  8005f4:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8005f7:	99                   	cltd   
  8005f8:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8005fb:	8b 45 14             	mov    0x14(%ebp),%eax
  8005fe:	8d 40 04             	lea    0x4(%eax),%eax
  800601:	89 45 14             	mov    %eax,0x14(%ebp)
  800604:	eb b4                	jmp    8005ba <vprintfmt+0x27e>
	if (lflag >= 2)
  800606:	83 f9 01             	cmp    $0x1,%ecx
  800609:	7f 1b                	jg     800626 <vprintfmt+0x2ea>
	else if (lflag)
  80060b:	85 c9                	test   %ecx,%ecx
  80060d:	74 2c                	je     80063b <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  80060f:	8b 45 14             	mov    0x14(%ebp),%eax
  800612:	8b 10                	mov    (%eax),%edx
  800614:	b9 00 00 00 00       	mov    $0x0,%ecx
  800619:	8d 40 04             	lea    0x4(%eax),%eax
  80061c:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80061f:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  800624:	eb 71                	jmp    800697 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800626:	8b 45 14             	mov    0x14(%ebp),%eax
  800629:	8b 10                	mov    (%eax),%edx
  80062b:	8b 48 04             	mov    0x4(%eax),%ecx
  80062e:	8d 40 08             	lea    0x8(%eax),%eax
  800631:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800634:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  800639:	eb 5c                	jmp    800697 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  80063b:	8b 45 14             	mov    0x14(%ebp),%eax
  80063e:	8b 10                	mov    (%eax),%edx
  800640:	b9 00 00 00 00       	mov    $0x0,%ecx
  800645:	8d 40 04             	lea    0x4(%eax),%eax
  800648:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80064b:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  800650:	eb 45                	jmp    800697 <vprintfmt+0x35b>
			putch('X', putdat);
  800652:	83 ec 08             	sub    $0x8,%esp
  800655:	53                   	push   %ebx
  800656:	6a 58                	push   $0x58
  800658:	ff d6                	call   *%esi
			putch('X', putdat);
  80065a:	83 c4 08             	add    $0x8,%esp
  80065d:	53                   	push   %ebx
  80065e:	6a 58                	push   $0x58
  800660:	ff d6                	call   *%esi
			putch('X', putdat);
  800662:	83 c4 08             	add    $0x8,%esp
  800665:	53                   	push   %ebx
  800666:	6a 58                	push   $0x58
  800668:	ff d6                	call   *%esi
			break;
  80066a:	83 c4 10             	add    $0x10,%esp
  80066d:	eb 42                	jmp    8006b1 <vprintfmt+0x375>
			putch('0', putdat);
  80066f:	83 ec 08             	sub    $0x8,%esp
  800672:	53                   	push   %ebx
  800673:	6a 30                	push   $0x30
  800675:	ff d6                	call   *%esi
			putch('x', putdat);
  800677:	83 c4 08             	add    $0x8,%esp
  80067a:	53                   	push   %ebx
  80067b:	6a 78                	push   $0x78
  80067d:	ff d6                	call   *%esi
			num = (unsigned long long)
  80067f:	8b 45 14             	mov    0x14(%ebp),%eax
  800682:	8b 10                	mov    (%eax),%edx
  800684:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  800689:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  80068c:	8d 40 04             	lea    0x4(%eax),%eax
  80068f:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800692:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  800697:	83 ec 0c             	sub    $0xc,%esp
  80069a:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  80069e:	57                   	push   %edi
  80069f:	ff 75 d4             	pushl  -0x2c(%ebp)
  8006a2:	50                   	push   %eax
  8006a3:	51                   	push   %ecx
  8006a4:	52                   	push   %edx
  8006a5:	89 da                	mov    %ebx,%edx
  8006a7:	89 f0                	mov    %esi,%eax
  8006a9:	e8 a3 fb ff ff       	call   800251 <printnum>
			break;
  8006ae:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  8006b1:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  8006b4:	83 c7 01             	add    $0x1,%edi
  8006b7:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  8006bb:	83 f8 25             	cmp    $0x25,%eax
  8006be:	0f 84 93 fc ff ff    	je     800357 <vprintfmt+0x1b>
			if (ch == '\0')
  8006c4:	85 c0                	test   %eax,%eax
  8006c6:	0f 84 8b 00 00 00    	je     800757 <vprintfmt+0x41b>
			putch(ch, putdat);
  8006cc:	83 ec 08             	sub    $0x8,%esp
  8006cf:	53                   	push   %ebx
  8006d0:	50                   	push   %eax
  8006d1:	ff d6                	call   *%esi
  8006d3:	83 c4 10             	add    $0x10,%esp
  8006d6:	eb dc                	jmp    8006b4 <vprintfmt+0x378>
	if (lflag >= 2)
  8006d8:	83 f9 01             	cmp    $0x1,%ecx
  8006db:	7f 1b                	jg     8006f8 <vprintfmt+0x3bc>
	else if (lflag)
  8006dd:	85 c9                	test   %ecx,%ecx
  8006df:	74 2c                	je     80070d <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  8006e1:	8b 45 14             	mov    0x14(%ebp),%eax
  8006e4:	8b 10                	mov    (%eax),%edx
  8006e6:	b9 00 00 00 00       	mov    $0x0,%ecx
  8006eb:	8d 40 04             	lea    0x4(%eax),%eax
  8006ee:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8006f1:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  8006f6:	eb 9f                	jmp    800697 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  8006f8:	8b 45 14             	mov    0x14(%ebp),%eax
  8006fb:	8b 10                	mov    (%eax),%edx
  8006fd:	8b 48 04             	mov    0x4(%eax),%ecx
  800700:	8d 40 08             	lea    0x8(%eax),%eax
  800703:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800706:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  80070b:	eb 8a                	jmp    800697 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  80070d:	8b 45 14             	mov    0x14(%ebp),%eax
  800710:	8b 10                	mov    (%eax),%edx
  800712:	b9 00 00 00 00       	mov    $0x0,%ecx
  800717:	8d 40 04             	lea    0x4(%eax),%eax
  80071a:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80071d:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  800722:	e9 70 ff ff ff       	jmp    800697 <vprintfmt+0x35b>
			putch(ch, putdat);
  800727:	83 ec 08             	sub    $0x8,%esp
  80072a:	53                   	push   %ebx
  80072b:	6a 25                	push   $0x25
  80072d:	ff d6                	call   *%esi
			break;
  80072f:	83 c4 10             	add    $0x10,%esp
  800732:	e9 7a ff ff ff       	jmp    8006b1 <vprintfmt+0x375>
			putch('%', putdat);
  800737:	83 ec 08             	sub    $0x8,%esp
  80073a:	53                   	push   %ebx
  80073b:	6a 25                	push   $0x25
  80073d:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  80073f:	83 c4 10             	add    $0x10,%esp
  800742:	89 f8                	mov    %edi,%eax
  800744:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  800748:	74 05                	je     80074f <vprintfmt+0x413>
  80074a:	83 e8 01             	sub    $0x1,%eax
  80074d:	eb f5                	jmp    800744 <vprintfmt+0x408>
  80074f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  800752:	e9 5a ff ff ff       	jmp    8006b1 <vprintfmt+0x375>
}
  800757:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80075a:	5b                   	pop    %ebx
  80075b:	5e                   	pop    %esi
  80075c:	5f                   	pop    %edi
  80075d:	5d                   	pop    %ebp
  80075e:	c3                   	ret    

0080075f <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  80075f:	f3 0f 1e fb          	endbr32 
  800763:	55                   	push   %ebp
  800764:	89 e5                	mov    %esp,%ebp
  800766:	83 ec 18             	sub    $0x18,%esp
  800769:	8b 45 08             	mov    0x8(%ebp),%eax
  80076c:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  80076f:	89 45 ec             	mov    %eax,-0x14(%ebp)
  800772:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  800776:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  800779:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  800780:	85 c0                	test   %eax,%eax
  800782:	74 26                	je     8007aa <vsnprintf+0x4b>
  800784:	85 d2                	test   %edx,%edx
  800786:	7e 22                	jle    8007aa <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  800788:	ff 75 14             	pushl  0x14(%ebp)
  80078b:	ff 75 10             	pushl  0x10(%ebp)
  80078e:	8d 45 ec             	lea    -0x14(%ebp),%eax
  800791:	50                   	push   %eax
  800792:	68 fa 02 80 00       	push   $0x8002fa
  800797:	e8 a0 fb ff ff       	call   80033c <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  80079c:	8b 45 ec             	mov    -0x14(%ebp),%eax
  80079f:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  8007a2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8007a5:	83 c4 10             	add    $0x10,%esp
}
  8007a8:	c9                   	leave  
  8007a9:	c3                   	ret    
		return -E_INVAL;
  8007aa:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8007af:	eb f7                	jmp    8007a8 <vsnprintf+0x49>

008007b1 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  8007b1:	f3 0f 1e fb          	endbr32 
  8007b5:	55                   	push   %ebp
  8007b6:	89 e5                	mov    %esp,%ebp
  8007b8:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  8007bb:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  8007be:	50                   	push   %eax
  8007bf:	ff 75 10             	pushl  0x10(%ebp)
  8007c2:	ff 75 0c             	pushl  0xc(%ebp)
  8007c5:	ff 75 08             	pushl  0x8(%ebp)
  8007c8:	e8 92 ff ff ff       	call   80075f <vsnprintf>
	va_end(ap);

	return rc;
}
  8007cd:	c9                   	leave  
  8007ce:	c3                   	ret    

008007cf <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  8007cf:	f3 0f 1e fb          	endbr32 
  8007d3:	55                   	push   %ebp
  8007d4:	89 e5                	mov    %esp,%ebp
  8007d6:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  8007d9:	b8 00 00 00 00       	mov    $0x0,%eax
  8007de:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  8007e2:	74 05                	je     8007e9 <strlen+0x1a>
		n++;
  8007e4:	83 c0 01             	add    $0x1,%eax
  8007e7:	eb f5                	jmp    8007de <strlen+0xf>
	return n;
}
  8007e9:	5d                   	pop    %ebp
  8007ea:	c3                   	ret    

008007eb <strnlen>:

int
strnlen(const char *s, size_t size)
{
  8007eb:	f3 0f 1e fb          	endbr32 
  8007ef:	55                   	push   %ebp
  8007f0:	89 e5                	mov    %esp,%ebp
  8007f2:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8007f5:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  8007f8:	b8 00 00 00 00       	mov    $0x0,%eax
  8007fd:	39 d0                	cmp    %edx,%eax
  8007ff:	74 0d                	je     80080e <strnlen+0x23>
  800801:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  800805:	74 05                	je     80080c <strnlen+0x21>
		n++;
  800807:	83 c0 01             	add    $0x1,%eax
  80080a:	eb f1                	jmp    8007fd <strnlen+0x12>
  80080c:	89 c2                	mov    %eax,%edx
	return n;
}
  80080e:	89 d0                	mov    %edx,%eax
  800810:	5d                   	pop    %ebp
  800811:	c3                   	ret    

00800812 <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  800812:	f3 0f 1e fb          	endbr32 
  800816:	55                   	push   %ebp
  800817:	89 e5                	mov    %esp,%ebp
  800819:	53                   	push   %ebx
  80081a:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80081d:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800820:	b8 00 00 00 00       	mov    $0x0,%eax
  800825:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  800829:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  80082c:	83 c0 01             	add    $0x1,%eax
  80082f:	84 d2                	test   %dl,%dl
  800831:	75 f2                	jne    800825 <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  800833:	89 c8                	mov    %ecx,%eax
  800835:	5b                   	pop    %ebx
  800836:	5d                   	pop    %ebp
  800837:	c3                   	ret    

00800838 <strcat>:

char *
strcat(char *dst, const char *src)
{
  800838:	f3 0f 1e fb          	endbr32 
  80083c:	55                   	push   %ebp
  80083d:	89 e5                	mov    %esp,%ebp
  80083f:	53                   	push   %ebx
  800840:	83 ec 10             	sub    $0x10,%esp
  800843:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  800846:	53                   	push   %ebx
  800847:	e8 83 ff ff ff       	call   8007cf <strlen>
  80084c:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  80084f:	ff 75 0c             	pushl  0xc(%ebp)
  800852:	01 d8                	add    %ebx,%eax
  800854:	50                   	push   %eax
  800855:	e8 b8 ff ff ff       	call   800812 <strcpy>
	return dst;
}
  80085a:	89 d8                	mov    %ebx,%eax
  80085c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80085f:	c9                   	leave  
  800860:	c3                   	ret    

00800861 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  800861:	f3 0f 1e fb          	endbr32 
  800865:	55                   	push   %ebp
  800866:	89 e5                	mov    %esp,%ebp
  800868:	56                   	push   %esi
  800869:	53                   	push   %ebx
  80086a:	8b 75 08             	mov    0x8(%ebp),%esi
  80086d:	8b 55 0c             	mov    0xc(%ebp),%edx
  800870:	89 f3                	mov    %esi,%ebx
  800872:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  800875:	89 f0                	mov    %esi,%eax
  800877:	39 d8                	cmp    %ebx,%eax
  800879:	74 11                	je     80088c <strncpy+0x2b>
		*dst++ = *src;
  80087b:	83 c0 01             	add    $0x1,%eax
  80087e:	0f b6 0a             	movzbl (%edx),%ecx
  800881:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  800884:	80 f9 01             	cmp    $0x1,%cl
  800887:	83 da ff             	sbb    $0xffffffff,%edx
  80088a:	eb eb                	jmp    800877 <strncpy+0x16>
	}
	return ret;
}
  80088c:	89 f0                	mov    %esi,%eax
  80088e:	5b                   	pop    %ebx
  80088f:	5e                   	pop    %esi
  800890:	5d                   	pop    %ebp
  800891:	c3                   	ret    

00800892 <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  800892:	f3 0f 1e fb          	endbr32 
  800896:	55                   	push   %ebp
  800897:	89 e5                	mov    %esp,%ebp
  800899:	56                   	push   %esi
  80089a:	53                   	push   %ebx
  80089b:	8b 75 08             	mov    0x8(%ebp),%esi
  80089e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8008a1:	8b 55 10             	mov    0x10(%ebp),%edx
  8008a4:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  8008a6:	85 d2                	test   %edx,%edx
  8008a8:	74 21                	je     8008cb <strlcpy+0x39>
  8008aa:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  8008ae:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  8008b0:	39 c2                	cmp    %eax,%edx
  8008b2:	74 14                	je     8008c8 <strlcpy+0x36>
  8008b4:	0f b6 19             	movzbl (%ecx),%ebx
  8008b7:	84 db                	test   %bl,%bl
  8008b9:	74 0b                	je     8008c6 <strlcpy+0x34>
			*dst++ = *src++;
  8008bb:	83 c1 01             	add    $0x1,%ecx
  8008be:	83 c2 01             	add    $0x1,%edx
  8008c1:	88 5a ff             	mov    %bl,-0x1(%edx)
  8008c4:	eb ea                	jmp    8008b0 <strlcpy+0x1e>
  8008c6:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  8008c8:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  8008cb:	29 f0                	sub    %esi,%eax
}
  8008cd:	5b                   	pop    %ebx
  8008ce:	5e                   	pop    %esi
  8008cf:	5d                   	pop    %ebp
  8008d0:	c3                   	ret    

008008d1 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  8008d1:	f3 0f 1e fb          	endbr32 
  8008d5:	55                   	push   %ebp
  8008d6:	89 e5                	mov    %esp,%ebp
  8008d8:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8008db:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  8008de:	0f b6 01             	movzbl (%ecx),%eax
  8008e1:	84 c0                	test   %al,%al
  8008e3:	74 0c                	je     8008f1 <strcmp+0x20>
  8008e5:	3a 02                	cmp    (%edx),%al
  8008e7:	75 08                	jne    8008f1 <strcmp+0x20>
		p++, q++;
  8008e9:	83 c1 01             	add    $0x1,%ecx
  8008ec:	83 c2 01             	add    $0x1,%edx
  8008ef:	eb ed                	jmp    8008de <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  8008f1:	0f b6 c0             	movzbl %al,%eax
  8008f4:	0f b6 12             	movzbl (%edx),%edx
  8008f7:	29 d0                	sub    %edx,%eax
}
  8008f9:	5d                   	pop    %ebp
  8008fa:	c3                   	ret    

008008fb <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  8008fb:	f3 0f 1e fb          	endbr32 
  8008ff:	55                   	push   %ebp
  800900:	89 e5                	mov    %esp,%ebp
  800902:	53                   	push   %ebx
  800903:	8b 45 08             	mov    0x8(%ebp),%eax
  800906:	8b 55 0c             	mov    0xc(%ebp),%edx
  800909:	89 c3                	mov    %eax,%ebx
  80090b:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  80090e:	eb 06                	jmp    800916 <strncmp+0x1b>
		n--, p++, q++;
  800910:	83 c0 01             	add    $0x1,%eax
  800913:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  800916:	39 d8                	cmp    %ebx,%eax
  800918:	74 16                	je     800930 <strncmp+0x35>
  80091a:	0f b6 08             	movzbl (%eax),%ecx
  80091d:	84 c9                	test   %cl,%cl
  80091f:	74 04                	je     800925 <strncmp+0x2a>
  800921:	3a 0a                	cmp    (%edx),%cl
  800923:	74 eb                	je     800910 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  800925:	0f b6 00             	movzbl (%eax),%eax
  800928:	0f b6 12             	movzbl (%edx),%edx
  80092b:	29 d0                	sub    %edx,%eax
}
  80092d:	5b                   	pop    %ebx
  80092e:	5d                   	pop    %ebp
  80092f:	c3                   	ret    
		return 0;
  800930:	b8 00 00 00 00       	mov    $0x0,%eax
  800935:	eb f6                	jmp    80092d <strncmp+0x32>

00800937 <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  800937:	f3 0f 1e fb          	endbr32 
  80093b:	55                   	push   %ebp
  80093c:	89 e5                	mov    %esp,%ebp
  80093e:	8b 45 08             	mov    0x8(%ebp),%eax
  800941:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  800945:	0f b6 10             	movzbl (%eax),%edx
  800948:	84 d2                	test   %dl,%dl
  80094a:	74 09                	je     800955 <strchr+0x1e>
		if (*s == c)
  80094c:	38 ca                	cmp    %cl,%dl
  80094e:	74 0a                	je     80095a <strchr+0x23>
	for (; *s; s++)
  800950:	83 c0 01             	add    $0x1,%eax
  800953:	eb f0                	jmp    800945 <strchr+0xe>
			return (char *) s;
	return 0;
  800955:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80095a:	5d                   	pop    %ebp
  80095b:	c3                   	ret    

0080095c <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  80095c:	f3 0f 1e fb          	endbr32 
  800960:	55                   	push   %ebp
  800961:	89 e5                	mov    %esp,%ebp
  800963:	8b 45 08             	mov    0x8(%ebp),%eax
  800966:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80096a:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  80096d:	38 ca                	cmp    %cl,%dl
  80096f:	74 09                	je     80097a <strfind+0x1e>
  800971:	84 d2                	test   %dl,%dl
  800973:	74 05                	je     80097a <strfind+0x1e>
	for (; *s; s++)
  800975:	83 c0 01             	add    $0x1,%eax
  800978:	eb f0                	jmp    80096a <strfind+0xe>
			break;
	return (char *) s;
}
  80097a:	5d                   	pop    %ebp
  80097b:	c3                   	ret    

0080097c <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  80097c:	f3 0f 1e fb          	endbr32 
  800980:	55                   	push   %ebp
  800981:	89 e5                	mov    %esp,%ebp
  800983:	57                   	push   %edi
  800984:	56                   	push   %esi
  800985:	53                   	push   %ebx
  800986:	8b 7d 08             	mov    0x8(%ebp),%edi
  800989:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  80098c:	85 c9                	test   %ecx,%ecx
  80098e:	74 31                	je     8009c1 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  800990:	89 f8                	mov    %edi,%eax
  800992:	09 c8                	or     %ecx,%eax
  800994:	a8 03                	test   $0x3,%al
  800996:	75 23                	jne    8009bb <memset+0x3f>
		c &= 0xFF;
  800998:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  80099c:	89 d3                	mov    %edx,%ebx
  80099e:	c1 e3 08             	shl    $0x8,%ebx
  8009a1:	89 d0                	mov    %edx,%eax
  8009a3:	c1 e0 18             	shl    $0x18,%eax
  8009a6:	89 d6                	mov    %edx,%esi
  8009a8:	c1 e6 10             	shl    $0x10,%esi
  8009ab:	09 f0                	or     %esi,%eax
  8009ad:	09 c2                	or     %eax,%edx
  8009af:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  8009b1:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  8009b4:	89 d0                	mov    %edx,%eax
  8009b6:	fc                   	cld    
  8009b7:	f3 ab                	rep stos %eax,%es:(%edi)
  8009b9:	eb 06                	jmp    8009c1 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  8009bb:	8b 45 0c             	mov    0xc(%ebp),%eax
  8009be:	fc                   	cld    
  8009bf:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  8009c1:	89 f8                	mov    %edi,%eax
  8009c3:	5b                   	pop    %ebx
  8009c4:	5e                   	pop    %esi
  8009c5:	5f                   	pop    %edi
  8009c6:	5d                   	pop    %ebp
  8009c7:	c3                   	ret    

008009c8 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  8009c8:	f3 0f 1e fb          	endbr32 
  8009cc:	55                   	push   %ebp
  8009cd:	89 e5                	mov    %esp,%ebp
  8009cf:	57                   	push   %edi
  8009d0:	56                   	push   %esi
  8009d1:	8b 45 08             	mov    0x8(%ebp),%eax
  8009d4:	8b 75 0c             	mov    0xc(%ebp),%esi
  8009d7:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  8009da:	39 c6                	cmp    %eax,%esi
  8009dc:	73 32                	jae    800a10 <memmove+0x48>
  8009de:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  8009e1:	39 c2                	cmp    %eax,%edx
  8009e3:	76 2b                	jbe    800a10 <memmove+0x48>
		s += n;
		d += n;
  8009e5:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  8009e8:	89 fe                	mov    %edi,%esi
  8009ea:	09 ce                	or     %ecx,%esi
  8009ec:	09 d6                	or     %edx,%esi
  8009ee:	f7 c6 03 00 00 00    	test   $0x3,%esi
  8009f4:	75 0e                	jne    800a04 <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  8009f6:	83 ef 04             	sub    $0x4,%edi
  8009f9:	8d 72 fc             	lea    -0x4(%edx),%esi
  8009fc:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  8009ff:	fd                   	std    
  800a00:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800a02:	eb 09                	jmp    800a0d <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  800a04:	83 ef 01             	sub    $0x1,%edi
  800a07:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800a0a:	fd                   	std    
  800a0b:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800a0d:	fc                   	cld    
  800a0e:	eb 1a                	jmp    800a2a <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800a10:	89 c2                	mov    %eax,%edx
  800a12:	09 ca                	or     %ecx,%edx
  800a14:	09 f2                	or     %esi,%edx
  800a16:	f6 c2 03             	test   $0x3,%dl
  800a19:	75 0a                	jne    800a25 <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800a1b:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800a1e:	89 c7                	mov    %eax,%edi
  800a20:	fc                   	cld    
  800a21:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800a23:	eb 05                	jmp    800a2a <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  800a25:	89 c7                	mov    %eax,%edi
  800a27:	fc                   	cld    
  800a28:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800a2a:	5e                   	pop    %esi
  800a2b:	5f                   	pop    %edi
  800a2c:	5d                   	pop    %ebp
  800a2d:	c3                   	ret    

00800a2e <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800a2e:	f3 0f 1e fb          	endbr32 
  800a32:	55                   	push   %ebp
  800a33:	89 e5                	mov    %esp,%ebp
  800a35:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800a38:	ff 75 10             	pushl  0x10(%ebp)
  800a3b:	ff 75 0c             	pushl  0xc(%ebp)
  800a3e:	ff 75 08             	pushl  0x8(%ebp)
  800a41:	e8 82 ff ff ff       	call   8009c8 <memmove>
}
  800a46:	c9                   	leave  
  800a47:	c3                   	ret    

00800a48 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800a48:	f3 0f 1e fb          	endbr32 
  800a4c:	55                   	push   %ebp
  800a4d:	89 e5                	mov    %esp,%ebp
  800a4f:	56                   	push   %esi
  800a50:	53                   	push   %ebx
  800a51:	8b 45 08             	mov    0x8(%ebp),%eax
  800a54:	8b 55 0c             	mov    0xc(%ebp),%edx
  800a57:	89 c6                	mov    %eax,%esi
  800a59:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800a5c:	39 f0                	cmp    %esi,%eax
  800a5e:	74 1c                	je     800a7c <memcmp+0x34>
		if (*s1 != *s2)
  800a60:	0f b6 08             	movzbl (%eax),%ecx
  800a63:	0f b6 1a             	movzbl (%edx),%ebx
  800a66:	38 d9                	cmp    %bl,%cl
  800a68:	75 08                	jne    800a72 <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  800a6a:	83 c0 01             	add    $0x1,%eax
  800a6d:	83 c2 01             	add    $0x1,%edx
  800a70:	eb ea                	jmp    800a5c <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  800a72:	0f b6 c1             	movzbl %cl,%eax
  800a75:	0f b6 db             	movzbl %bl,%ebx
  800a78:	29 d8                	sub    %ebx,%eax
  800a7a:	eb 05                	jmp    800a81 <memcmp+0x39>
	}

	return 0;
  800a7c:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800a81:	5b                   	pop    %ebx
  800a82:	5e                   	pop    %esi
  800a83:	5d                   	pop    %ebp
  800a84:	c3                   	ret    

00800a85 <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  800a85:	f3 0f 1e fb          	endbr32 
  800a89:	55                   	push   %ebp
  800a8a:	89 e5                	mov    %esp,%ebp
  800a8c:	8b 45 08             	mov    0x8(%ebp),%eax
  800a8f:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  800a92:	89 c2                	mov    %eax,%edx
  800a94:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800a97:	39 d0                	cmp    %edx,%eax
  800a99:	73 09                	jae    800aa4 <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800a9b:	38 08                	cmp    %cl,(%eax)
  800a9d:	74 05                	je     800aa4 <memfind+0x1f>
	for (; s < ends; s++)
  800a9f:	83 c0 01             	add    $0x1,%eax
  800aa2:	eb f3                	jmp    800a97 <memfind+0x12>
			break;
	return (void *) s;
}
  800aa4:	5d                   	pop    %ebp
  800aa5:	c3                   	ret    

00800aa6 <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800aa6:	f3 0f 1e fb          	endbr32 
  800aaa:	55                   	push   %ebp
  800aab:	89 e5                	mov    %esp,%ebp
  800aad:	57                   	push   %edi
  800aae:	56                   	push   %esi
  800aaf:	53                   	push   %ebx
  800ab0:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800ab3:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800ab6:	eb 03                	jmp    800abb <strtol+0x15>
		s++;
  800ab8:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800abb:	0f b6 01             	movzbl (%ecx),%eax
  800abe:	3c 20                	cmp    $0x20,%al
  800ac0:	74 f6                	je     800ab8 <strtol+0x12>
  800ac2:	3c 09                	cmp    $0x9,%al
  800ac4:	74 f2                	je     800ab8 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800ac6:	3c 2b                	cmp    $0x2b,%al
  800ac8:	74 2a                	je     800af4 <strtol+0x4e>
	int neg = 0;
  800aca:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800acf:	3c 2d                	cmp    $0x2d,%al
  800ad1:	74 2b                	je     800afe <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800ad3:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800ad9:	75 0f                	jne    800aea <strtol+0x44>
  800adb:	80 39 30             	cmpb   $0x30,(%ecx)
  800ade:	74 28                	je     800b08 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800ae0:	85 db                	test   %ebx,%ebx
  800ae2:	b8 0a 00 00 00       	mov    $0xa,%eax
  800ae7:	0f 44 d8             	cmove  %eax,%ebx
  800aea:	b8 00 00 00 00       	mov    $0x0,%eax
  800aef:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800af2:	eb 46                	jmp    800b3a <strtol+0x94>
		s++;
  800af4:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800af7:	bf 00 00 00 00       	mov    $0x0,%edi
  800afc:	eb d5                	jmp    800ad3 <strtol+0x2d>
		s++, neg = 1;
  800afe:	83 c1 01             	add    $0x1,%ecx
  800b01:	bf 01 00 00 00       	mov    $0x1,%edi
  800b06:	eb cb                	jmp    800ad3 <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800b08:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800b0c:	74 0e                	je     800b1c <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800b0e:	85 db                	test   %ebx,%ebx
  800b10:	75 d8                	jne    800aea <strtol+0x44>
		s++, base = 8;
  800b12:	83 c1 01             	add    $0x1,%ecx
  800b15:	bb 08 00 00 00       	mov    $0x8,%ebx
  800b1a:	eb ce                	jmp    800aea <strtol+0x44>
		s += 2, base = 16;
  800b1c:	83 c1 02             	add    $0x2,%ecx
  800b1f:	bb 10 00 00 00       	mov    $0x10,%ebx
  800b24:	eb c4                	jmp    800aea <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800b26:	0f be d2             	movsbl %dl,%edx
  800b29:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800b2c:	3b 55 10             	cmp    0x10(%ebp),%edx
  800b2f:	7d 3a                	jge    800b6b <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800b31:	83 c1 01             	add    $0x1,%ecx
  800b34:	0f af 45 10          	imul   0x10(%ebp),%eax
  800b38:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800b3a:	0f b6 11             	movzbl (%ecx),%edx
  800b3d:	8d 72 d0             	lea    -0x30(%edx),%esi
  800b40:	89 f3                	mov    %esi,%ebx
  800b42:	80 fb 09             	cmp    $0x9,%bl
  800b45:	76 df                	jbe    800b26 <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800b47:	8d 72 9f             	lea    -0x61(%edx),%esi
  800b4a:	89 f3                	mov    %esi,%ebx
  800b4c:	80 fb 19             	cmp    $0x19,%bl
  800b4f:	77 08                	ja     800b59 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800b51:	0f be d2             	movsbl %dl,%edx
  800b54:	83 ea 57             	sub    $0x57,%edx
  800b57:	eb d3                	jmp    800b2c <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800b59:	8d 72 bf             	lea    -0x41(%edx),%esi
  800b5c:	89 f3                	mov    %esi,%ebx
  800b5e:	80 fb 19             	cmp    $0x19,%bl
  800b61:	77 08                	ja     800b6b <strtol+0xc5>
			dig = *s - 'A' + 10;
  800b63:	0f be d2             	movsbl %dl,%edx
  800b66:	83 ea 37             	sub    $0x37,%edx
  800b69:	eb c1                	jmp    800b2c <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800b6b:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800b6f:	74 05                	je     800b76 <strtol+0xd0>
		*endptr = (char *) s;
  800b71:	8b 75 0c             	mov    0xc(%ebp),%esi
  800b74:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800b76:	89 c2                	mov    %eax,%edx
  800b78:	f7 da                	neg    %edx
  800b7a:	85 ff                	test   %edi,%edi
  800b7c:	0f 45 c2             	cmovne %edx,%eax
}
  800b7f:	5b                   	pop    %ebx
  800b80:	5e                   	pop    %esi
  800b81:	5f                   	pop    %edi
  800b82:	5d                   	pop    %ebp
  800b83:	c3                   	ret    

00800b84 <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800b84:	f3 0f 1e fb          	endbr32 
  800b88:	55                   	push   %ebp
  800b89:	89 e5                	mov    %esp,%ebp
  800b8b:	57                   	push   %edi
  800b8c:	56                   	push   %esi
  800b8d:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b8e:	b8 00 00 00 00       	mov    $0x0,%eax
  800b93:	8b 55 08             	mov    0x8(%ebp),%edx
  800b96:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800b99:	89 c3                	mov    %eax,%ebx
  800b9b:	89 c7                	mov    %eax,%edi
  800b9d:	89 c6                	mov    %eax,%esi
  800b9f:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800ba1:	5b                   	pop    %ebx
  800ba2:	5e                   	pop    %esi
  800ba3:	5f                   	pop    %edi
  800ba4:	5d                   	pop    %ebp
  800ba5:	c3                   	ret    

00800ba6 <sys_cgetc>:

int
sys_cgetc(void)
{
  800ba6:	f3 0f 1e fb          	endbr32 
  800baa:	55                   	push   %ebp
  800bab:	89 e5                	mov    %esp,%ebp
  800bad:	57                   	push   %edi
  800bae:	56                   	push   %esi
  800baf:	53                   	push   %ebx
	asm volatile("int %1\n"
  800bb0:	ba 00 00 00 00       	mov    $0x0,%edx
  800bb5:	b8 01 00 00 00       	mov    $0x1,%eax
  800bba:	89 d1                	mov    %edx,%ecx
  800bbc:	89 d3                	mov    %edx,%ebx
  800bbe:	89 d7                	mov    %edx,%edi
  800bc0:	89 d6                	mov    %edx,%esi
  800bc2:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800bc4:	5b                   	pop    %ebx
  800bc5:	5e                   	pop    %esi
  800bc6:	5f                   	pop    %edi
  800bc7:	5d                   	pop    %ebp
  800bc8:	c3                   	ret    

00800bc9 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800bc9:	f3 0f 1e fb          	endbr32 
  800bcd:	55                   	push   %ebp
  800bce:	89 e5                	mov    %esp,%ebp
  800bd0:	57                   	push   %edi
  800bd1:	56                   	push   %esi
  800bd2:	53                   	push   %ebx
  800bd3:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800bd6:	b9 00 00 00 00       	mov    $0x0,%ecx
  800bdb:	8b 55 08             	mov    0x8(%ebp),%edx
  800bde:	b8 03 00 00 00       	mov    $0x3,%eax
  800be3:	89 cb                	mov    %ecx,%ebx
  800be5:	89 cf                	mov    %ecx,%edi
  800be7:	89 ce                	mov    %ecx,%esi
  800be9:	cd 30                	int    $0x30
	if(check && ret > 0)
  800beb:	85 c0                	test   %eax,%eax
  800bed:	7f 08                	jg     800bf7 <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800bef:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bf2:	5b                   	pop    %ebx
  800bf3:	5e                   	pop    %esi
  800bf4:	5f                   	pop    %edi
  800bf5:	5d                   	pop    %ebp
  800bf6:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800bf7:	83 ec 0c             	sub    $0xc,%esp
  800bfa:	50                   	push   %eax
  800bfb:	6a 03                	push   $0x3
  800bfd:	68 3f 23 80 00       	push   $0x80233f
  800c02:	6a 23                	push   $0x23
  800c04:	68 5c 23 80 00       	push   $0x80235c
  800c09:	e8 44 f5 ff ff       	call   800152 <_panic>

00800c0e <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800c0e:	f3 0f 1e fb          	endbr32 
  800c12:	55                   	push   %ebp
  800c13:	89 e5                	mov    %esp,%ebp
  800c15:	57                   	push   %edi
  800c16:	56                   	push   %esi
  800c17:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c18:	ba 00 00 00 00       	mov    $0x0,%edx
  800c1d:	b8 02 00 00 00       	mov    $0x2,%eax
  800c22:	89 d1                	mov    %edx,%ecx
  800c24:	89 d3                	mov    %edx,%ebx
  800c26:	89 d7                	mov    %edx,%edi
  800c28:	89 d6                	mov    %edx,%esi
  800c2a:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800c2c:	5b                   	pop    %ebx
  800c2d:	5e                   	pop    %esi
  800c2e:	5f                   	pop    %edi
  800c2f:	5d                   	pop    %ebp
  800c30:	c3                   	ret    

00800c31 <sys_yield>:

void
sys_yield(void)
{
  800c31:	f3 0f 1e fb          	endbr32 
  800c35:	55                   	push   %ebp
  800c36:	89 e5                	mov    %esp,%ebp
  800c38:	57                   	push   %edi
  800c39:	56                   	push   %esi
  800c3a:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c3b:	ba 00 00 00 00       	mov    $0x0,%edx
  800c40:	b8 0b 00 00 00       	mov    $0xb,%eax
  800c45:	89 d1                	mov    %edx,%ecx
  800c47:	89 d3                	mov    %edx,%ebx
  800c49:	89 d7                	mov    %edx,%edi
  800c4b:	89 d6                	mov    %edx,%esi
  800c4d:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800c4f:	5b                   	pop    %ebx
  800c50:	5e                   	pop    %esi
  800c51:	5f                   	pop    %edi
  800c52:	5d                   	pop    %ebp
  800c53:	c3                   	ret    

00800c54 <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800c54:	f3 0f 1e fb          	endbr32 
  800c58:	55                   	push   %ebp
  800c59:	89 e5                	mov    %esp,%ebp
  800c5b:	57                   	push   %edi
  800c5c:	56                   	push   %esi
  800c5d:	53                   	push   %ebx
  800c5e:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c61:	be 00 00 00 00       	mov    $0x0,%esi
  800c66:	8b 55 08             	mov    0x8(%ebp),%edx
  800c69:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c6c:	b8 04 00 00 00       	mov    $0x4,%eax
  800c71:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800c74:	89 f7                	mov    %esi,%edi
  800c76:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c78:	85 c0                	test   %eax,%eax
  800c7a:	7f 08                	jg     800c84 <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800c7c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c7f:	5b                   	pop    %ebx
  800c80:	5e                   	pop    %esi
  800c81:	5f                   	pop    %edi
  800c82:	5d                   	pop    %ebp
  800c83:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c84:	83 ec 0c             	sub    $0xc,%esp
  800c87:	50                   	push   %eax
  800c88:	6a 04                	push   $0x4
  800c8a:	68 3f 23 80 00       	push   $0x80233f
  800c8f:	6a 23                	push   $0x23
  800c91:	68 5c 23 80 00       	push   $0x80235c
  800c96:	e8 b7 f4 ff ff       	call   800152 <_panic>

00800c9b <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800c9b:	f3 0f 1e fb          	endbr32 
  800c9f:	55                   	push   %ebp
  800ca0:	89 e5                	mov    %esp,%ebp
  800ca2:	57                   	push   %edi
  800ca3:	56                   	push   %esi
  800ca4:	53                   	push   %ebx
  800ca5:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800ca8:	8b 55 08             	mov    0x8(%ebp),%edx
  800cab:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cae:	b8 05 00 00 00       	mov    $0x5,%eax
  800cb3:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800cb6:	8b 7d 14             	mov    0x14(%ebp),%edi
  800cb9:	8b 75 18             	mov    0x18(%ebp),%esi
  800cbc:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cbe:	85 c0                	test   %eax,%eax
  800cc0:	7f 08                	jg     800cca <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800cc2:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cc5:	5b                   	pop    %ebx
  800cc6:	5e                   	pop    %esi
  800cc7:	5f                   	pop    %edi
  800cc8:	5d                   	pop    %ebp
  800cc9:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cca:	83 ec 0c             	sub    $0xc,%esp
  800ccd:	50                   	push   %eax
  800cce:	6a 05                	push   $0x5
  800cd0:	68 3f 23 80 00       	push   $0x80233f
  800cd5:	6a 23                	push   $0x23
  800cd7:	68 5c 23 80 00       	push   $0x80235c
  800cdc:	e8 71 f4 ff ff       	call   800152 <_panic>

00800ce1 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800ce1:	f3 0f 1e fb          	endbr32 
  800ce5:	55                   	push   %ebp
  800ce6:	89 e5                	mov    %esp,%ebp
  800ce8:	57                   	push   %edi
  800ce9:	56                   	push   %esi
  800cea:	53                   	push   %ebx
  800ceb:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cee:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cf3:	8b 55 08             	mov    0x8(%ebp),%edx
  800cf6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cf9:	b8 06 00 00 00       	mov    $0x6,%eax
  800cfe:	89 df                	mov    %ebx,%edi
  800d00:	89 de                	mov    %ebx,%esi
  800d02:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d04:	85 c0                	test   %eax,%eax
  800d06:	7f 08                	jg     800d10 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800d08:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d0b:	5b                   	pop    %ebx
  800d0c:	5e                   	pop    %esi
  800d0d:	5f                   	pop    %edi
  800d0e:	5d                   	pop    %ebp
  800d0f:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d10:	83 ec 0c             	sub    $0xc,%esp
  800d13:	50                   	push   %eax
  800d14:	6a 06                	push   $0x6
  800d16:	68 3f 23 80 00       	push   $0x80233f
  800d1b:	6a 23                	push   $0x23
  800d1d:	68 5c 23 80 00       	push   $0x80235c
  800d22:	e8 2b f4 ff ff       	call   800152 <_panic>

00800d27 <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800d27:	f3 0f 1e fb          	endbr32 
  800d2b:	55                   	push   %ebp
  800d2c:	89 e5                	mov    %esp,%ebp
  800d2e:	57                   	push   %edi
  800d2f:	56                   	push   %esi
  800d30:	53                   	push   %ebx
  800d31:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d34:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d39:	8b 55 08             	mov    0x8(%ebp),%edx
  800d3c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d3f:	b8 08 00 00 00       	mov    $0x8,%eax
  800d44:	89 df                	mov    %ebx,%edi
  800d46:	89 de                	mov    %ebx,%esi
  800d48:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d4a:	85 c0                	test   %eax,%eax
  800d4c:	7f 08                	jg     800d56 <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800d4e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d51:	5b                   	pop    %ebx
  800d52:	5e                   	pop    %esi
  800d53:	5f                   	pop    %edi
  800d54:	5d                   	pop    %ebp
  800d55:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d56:	83 ec 0c             	sub    $0xc,%esp
  800d59:	50                   	push   %eax
  800d5a:	6a 08                	push   $0x8
  800d5c:	68 3f 23 80 00       	push   $0x80233f
  800d61:	6a 23                	push   $0x23
  800d63:	68 5c 23 80 00       	push   $0x80235c
  800d68:	e8 e5 f3 ff ff       	call   800152 <_panic>

00800d6d <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800d6d:	f3 0f 1e fb          	endbr32 
  800d71:	55                   	push   %ebp
  800d72:	89 e5                	mov    %esp,%ebp
  800d74:	57                   	push   %edi
  800d75:	56                   	push   %esi
  800d76:	53                   	push   %ebx
  800d77:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d7a:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d7f:	8b 55 08             	mov    0x8(%ebp),%edx
  800d82:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d85:	b8 09 00 00 00       	mov    $0x9,%eax
  800d8a:	89 df                	mov    %ebx,%edi
  800d8c:	89 de                	mov    %ebx,%esi
  800d8e:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d90:	85 c0                	test   %eax,%eax
  800d92:	7f 08                	jg     800d9c <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800d94:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d97:	5b                   	pop    %ebx
  800d98:	5e                   	pop    %esi
  800d99:	5f                   	pop    %edi
  800d9a:	5d                   	pop    %ebp
  800d9b:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d9c:	83 ec 0c             	sub    $0xc,%esp
  800d9f:	50                   	push   %eax
  800da0:	6a 09                	push   $0x9
  800da2:	68 3f 23 80 00       	push   $0x80233f
  800da7:	6a 23                	push   $0x23
  800da9:	68 5c 23 80 00       	push   $0x80235c
  800dae:	e8 9f f3 ff ff       	call   800152 <_panic>

00800db3 <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800db3:	f3 0f 1e fb          	endbr32 
  800db7:	55                   	push   %ebp
  800db8:	89 e5                	mov    %esp,%ebp
  800dba:	57                   	push   %edi
  800dbb:	56                   	push   %esi
  800dbc:	53                   	push   %ebx
  800dbd:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800dc0:	bb 00 00 00 00       	mov    $0x0,%ebx
  800dc5:	8b 55 08             	mov    0x8(%ebp),%edx
  800dc8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800dcb:	b8 0a 00 00 00       	mov    $0xa,%eax
  800dd0:	89 df                	mov    %ebx,%edi
  800dd2:	89 de                	mov    %ebx,%esi
  800dd4:	cd 30                	int    $0x30
	if(check && ret > 0)
  800dd6:	85 c0                	test   %eax,%eax
  800dd8:	7f 08                	jg     800de2 <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800dda:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ddd:	5b                   	pop    %ebx
  800dde:	5e                   	pop    %esi
  800ddf:	5f                   	pop    %edi
  800de0:	5d                   	pop    %ebp
  800de1:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800de2:	83 ec 0c             	sub    $0xc,%esp
  800de5:	50                   	push   %eax
  800de6:	6a 0a                	push   $0xa
  800de8:	68 3f 23 80 00       	push   $0x80233f
  800ded:	6a 23                	push   $0x23
  800def:	68 5c 23 80 00       	push   $0x80235c
  800df4:	e8 59 f3 ff ff       	call   800152 <_panic>

00800df9 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800df9:	f3 0f 1e fb          	endbr32 
  800dfd:	55                   	push   %ebp
  800dfe:	89 e5                	mov    %esp,%ebp
  800e00:	57                   	push   %edi
  800e01:	56                   	push   %esi
  800e02:	53                   	push   %ebx
	asm volatile("int %1\n"
  800e03:	8b 55 08             	mov    0x8(%ebp),%edx
  800e06:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800e09:	b8 0c 00 00 00       	mov    $0xc,%eax
  800e0e:	be 00 00 00 00       	mov    $0x0,%esi
  800e13:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800e16:	8b 7d 14             	mov    0x14(%ebp),%edi
  800e19:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800e1b:	5b                   	pop    %ebx
  800e1c:	5e                   	pop    %esi
  800e1d:	5f                   	pop    %edi
  800e1e:	5d                   	pop    %ebp
  800e1f:	c3                   	ret    

00800e20 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800e20:	f3 0f 1e fb          	endbr32 
  800e24:	55                   	push   %ebp
  800e25:	89 e5                	mov    %esp,%ebp
  800e27:	57                   	push   %edi
  800e28:	56                   	push   %esi
  800e29:	53                   	push   %ebx
  800e2a:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800e2d:	b9 00 00 00 00       	mov    $0x0,%ecx
  800e32:	8b 55 08             	mov    0x8(%ebp),%edx
  800e35:	b8 0d 00 00 00       	mov    $0xd,%eax
  800e3a:	89 cb                	mov    %ecx,%ebx
  800e3c:	89 cf                	mov    %ecx,%edi
  800e3e:	89 ce                	mov    %ecx,%esi
  800e40:	cd 30                	int    $0x30
	if(check && ret > 0)
  800e42:	85 c0                	test   %eax,%eax
  800e44:	7f 08                	jg     800e4e <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800e46:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800e49:	5b                   	pop    %ebx
  800e4a:	5e                   	pop    %esi
  800e4b:	5f                   	pop    %edi
  800e4c:	5d                   	pop    %ebp
  800e4d:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800e4e:	83 ec 0c             	sub    $0xc,%esp
  800e51:	50                   	push   %eax
  800e52:	6a 0d                	push   $0xd
  800e54:	68 3f 23 80 00       	push   $0x80233f
  800e59:	6a 23                	push   $0x23
  800e5b:	68 5c 23 80 00       	push   $0x80235c
  800e60:	e8 ed f2 ff ff       	call   800152 <_panic>

00800e65 <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800e65:	f3 0f 1e fb          	endbr32 
  800e69:	55                   	push   %ebp
  800e6a:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800e6c:	8b 45 08             	mov    0x8(%ebp),%eax
  800e6f:	05 00 00 00 30       	add    $0x30000000,%eax
  800e74:	c1 e8 0c             	shr    $0xc,%eax
}
  800e77:	5d                   	pop    %ebp
  800e78:	c3                   	ret    

00800e79 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800e79:	f3 0f 1e fb          	endbr32 
  800e7d:	55                   	push   %ebp
  800e7e:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800e80:	8b 45 08             	mov    0x8(%ebp),%eax
  800e83:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800e88:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800e8d:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800e92:	5d                   	pop    %ebp
  800e93:	c3                   	ret    

00800e94 <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800e94:	f3 0f 1e fb          	endbr32 
  800e98:	55                   	push   %ebp
  800e99:	89 e5                	mov    %esp,%ebp
  800e9b:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800ea0:	89 c2                	mov    %eax,%edx
  800ea2:	c1 ea 16             	shr    $0x16,%edx
  800ea5:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800eac:	f6 c2 01             	test   $0x1,%dl
  800eaf:	74 2d                	je     800ede <fd_alloc+0x4a>
  800eb1:	89 c2                	mov    %eax,%edx
  800eb3:	c1 ea 0c             	shr    $0xc,%edx
  800eb6:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800ebd:	f6 c2 01             	test   $0x1,%dl
  800ec0:	74 1c                	je     800ede <fd_alloc+0x4a>
  800ec2:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800ec7:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800ecc:	75 d2                	jne    800ea0 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800ece:	8b 45 08             	mov    0x8(%ebp),%eax
  800ed1:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800ed7:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800edc:	eb 0a                	jmp    800ee8 <fd_alloc+0x54>
			*fd_store = fd;
  800ede:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800ee1:	89 01                	mov    %eax,(%ecx)
			return 0;
  800ee3:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800ee8:	5d                   	pop    %ebp
  800ee9:	c3                   	ret    

00800eea <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800eea:	f3 0f 1e fb          	endbr32 
  800eee:	55                   	push   %ebp
  800eef:	89 e5                	mov    %esp,%ebp
  800ef1:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800ef4:	83 f8 1f             	cmp    $0x1f,%eax
  800ef7:	77 30                	ja     800f29 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800ef9:	c1 e0 0c             	shl    $0xc,%eax
  800efc:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800f01:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800f07:	f6 c2 01             	test   $0x1,%dl
  800f0a:	74 24                	je     800f30 <fd_lookup+0x46>
  800f0c:	89 c2                	mov    %eax,%edx
  800f0e:	c1 ea 0c             	shr    $0xc,%edx
  800f11:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800f18:	f6 c2 01             	test   $0x1,%dl
  800f1b:	74 1a                	je     800f37 <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800f1d:	8b 55 0c             	mov    0xc(%ebp),%edx
  800f20:	89 02                	mov    %eax,(%edx)
	return 0;
  800f22:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800f27:	5d                   	pop    %ebp
  800f28:	c3                   	ret    
		return -E_INVAL;
  800f29:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f2e:	eb f7                	jmp    800f27 <fd_lookup+0x3d>
		return -E_INVAL;
  800f30:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f35:	eb f0                	jmp    800f27 <fd_lookup+0x3d>
  800f37:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800f3c:	eb e9                	jmp    800f27 <fd_lookup+0x3d>

00800f3e <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800f3e:	f3 0f 1e fb          	endbr32 
  800f42:	55                   	push   %ebp
  800f43:	89 e5                	mov    %esp,%ebp
  800f45:	83 ec 08             	sub    $0x8,%esp
  800f48:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800f4b:	ba e8 23 80 00       	mov    $0x8023e8,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800f50:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800f55:	39 08                	cmp    %ecx,(%eax)
  800f57:	74 33                	je     800f8c <dev_lookup+0x4e>
  800f59:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800f5c:	8b 02                	mov    (%edx),%eax
  800f5e:	85 c0                	test   %eax,%eax
  800f60:	75 f3                	jne    800f55 <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800f62:	a1 20 40 c0 00       	mov    0xc04020,%eax
  800f67:	8b 40 48             	mov    0x48(%eax),%eax
  800f6a:	83 ec 04             	sub    $0x4,%esp
  800f6d:	51                   	push   %ecx
  800f6e:	50                   	push   %eax
  800f6f:	68 6c 23 80 00       	push   $0x80236c
  800f74:	e8 c0 f2 ff ff       	call   800239 <cprintf>
	*dev = 0;
  800f79:	8b 45 0c             	mov    0xc(%ebp),%eax
  800f7c:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  800f82:	83 c4 10             	add    $0x10,%esp
  800f85:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800f8a:	c9                   	leave  
  800f8b:	c3                   	ret    
			*dev = devtab[i];
  800f8c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800f8f:	89 01                	mov    %eax,(%ecx)
			return 0;
  800f91:	b8 00 00 00 00       	mov    $0x0,%eax
  800f96:	eb f2                	jmp    800f8a <dev_lookup+0x4c>

00800f98 <fd_close>:
{
  800f98:	f3 0f 1e fb          	endbr32 
  800f9c:	55                   	push   %ebp
  800f9d:	89 e5                	mov    %esp,%ebp
  800f9f:	57                   	push   %edi
  800fa0:	56                   	push   %esi
  800fa1:	53                   	push   %ebx
  800fa2:	83 ec 24             	sub    $0x24,%esp
  800fa5:	8b 75 08             	mov    0x8(%ebp),%esi
  800fa8:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800fab:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800fae:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800faf:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  800fb5:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800fb8:	50                   	push   %eax
  800fb9:	e8 2c ff ff ff       	call   800eea <fd_lookup>
  800fbe:	89 c3                	mov    %eax,%ebx
  800fc0:	83 c4 10             	add    $0x10,%esp
  800fc3:	85 c0                	test   %eax,%eax
  800fc5:	78 05                	js     800fcc <fd_close+0x34>
	    || fd != fd2)
  800fc7:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  800fca:	74 16                	je     800fe2 <fd_close+0x4a>
		return (must_exist ? r : 0);
  800fcc:	89 f8                	mov    %edi,%eax
  800fce:	84 c0                	test   %al,%al
  800fd0:	b8 00 00 00 00       	mov    $0x0,%eax
  800fd5:	0f 44 d8             	cmove  %eax,%ebx
}
  800fd8:	89 d8                	mov    %ebx,%eax
  800fda:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800fdd:	5b                   	pop    %ebx
  800fde:	5e                   	pop    %esi
  800fdf:	5f                   	pop    %edi
  800fe0:	5d                   	pop    %ebp
  800fe1:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  800fe2:	83 ec 08             	sub    $0x8,%esp
  800fe5:	8d 45 e0             	lea    -0x20(%ebp),%eax
  800fe8:	50                   	push   %eax
  800fe9:	ff 36                	pushl  (%esi)
  800feb:	e8 4e ff ff ff       	call   800f3e <dev_lookup>
  800ff0:	89 c3                	mov    %eax,%ebx
  800ff2:	83 c4 10             	add    $0x10,%esp
  800ff5:	85 c0                	test   %eax,%eax
  800ff7:	78 1a                	js     801013 <fd_close+0x7b>
		if (dev->dev_close)
  800ff9:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800ffc:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  800fff:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  801004:	85 c0                	test   %eax,%eax
  801006:	74 0b                	je     801013 <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  801008:	83 ec 0c             	sub    $0xc,%esp
  80100b:	56                   	push   %esi
  80100c:	ff d0                	call   *%eax
  80100e:	89 c3                	mov    %eax,%ebx
  801010:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  801013:	83 ec 08             	sub    $0x8,%esp
  801016:	56                   	push   %esi
  801017:	6a 00                	push   $0x0
  801019:	e8 c3 fc ff ff       	call   800ce1 <sys_page_unmap>
	return r;
  80101e:	83 c4 10             	add    $0x10,%esp
  801021:	eb b5                	jmp    800fd8 <fd_close+0x40>

00801023 <close>:

int
close(int fdnum)
{
  801023:	f3 0f 1e fb          	endbr32 
  801027:	55                   	push   %ebp
  801028:	89 e5                	mov    %esp,%ebp
  80102a:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80102d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801030:	50                   	push   %eax
  801031:	ff 75 08             	pushl  0x8(%ebp)
  801034:	e8 b1 fe ff ff       	call   800eea <fd_lookup>
  801039:	83 c4 10             	add    $0x10,%esp
  80103c:	85 c0                	test   %eax,%eax
  80103e:	79 02                	jns    801042 <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  801040:	c9                   	leave  
  801041:	c3                   	ret    
		return fd_close(fd, 1);
  801042:	83 ec 08             	sub    $0x8,%esp
  801045:	6a 01                	push   $0x1
  801047:	ff 75 f4             	pushl  -0xc(%ebp)
  80104a:	e8 49 ff ff ff       	call   800f98 <fd_close>
  80104f:	83 c4 10             	add    $0x10,%esp
  801052:	eb ec                	jmp    801040 <close+0x1d>

00801054 <close_all>:

void
close_all(void)
{
  801054:	f3 0f 1e fb          	endbr32 
  801058:	55                   	push   %ebp
  801059:	89 e5                	mov    %esp,%ebp
  80105b:	53                   	push   %ebx
  80105c:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  80105f:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  801064:	83 ec 0c             	sub    $0xc,%esp
  801067:	53                   	push   %ebx
  801068:	e8 b6 ff ff ff       	call   801023 <close>
	for (i = 0; i < MAXFD; i++)
  80106d:	83 c3 01             	add    $0x1,%ebx
  801070:	83 c4 10             	add    $0x10,%esp
  801073:	83 fb 20             	cmp    $0x20,%ebx
  801076:	75 ec                	jne    801064 <close_all+0x10>
}
  801078:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80107b:	c9                   	leave  
  80107c:	c3                   	ret    

0080107d <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  80107d:	f3 0f 1e fb          	endbr32 
  801081:	55                   	push   %ebp
  801082:	89 e5                	mov    %esp,%ebp
  801084:	57                   	push   %edi
  801085:	56                   	push   %esi
  801086:	53                   	push   %ebx
  801087:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  80108a:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80108d:	50                   	push   %eax
  80108e:	ff 75 08             	pushl  0x8(%ebp)
  801091:	e8 54 fe ff ff       	call   800eea <fd_lookup>
  801096:	89 c3                	mov    %eax,%ebx
  801098:	83 c4 10             	add    $0x10,%esp
  80109b:	85 c0                	test   %eax,%eax
  80109d:	0f 88 81 00 00 00    	js     801124 <dup+0xa7>
		return r;
	close(newfdnum);
  8010a3:	83 ec 0c             	sub    $0xc,%esp
  8010a6:	ff 75 0c             	pushl  0xc(%ebp)
  8010a9:	e8 75 ff ff ff       	call   801023 <close>

	newfd = INDEX2FD(newfdnum);
  8010ae:	8b 75 0c             	mov    0xc(%ebp),%esi
  8010b1:	c1 e6 0c             	shl    $0xc,%esi
  8010b4:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  8010ba:	83 c4 04             	add    $0x4,%esp
  8010bd:	ff 75 e4             	pushl  -0x1c(%ebp)
  8010c0:	e8 b4 fd ff ff       	call   800e79 <fd2data>
  8010c5:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  8010c7:	89 34 24             	mov    %esi,(%esp)
  8010ca:	e8 aa fd ff ff       	call   800e79 <fd2data>
  8010cf:	83 c4 10             	add    $0x10,%esp
  8010d2:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  8010d4:	89 d8                	mov    %ebx,%eax
  8010d6:	c1 e8 16             	shr    $0x16,%eax
  8010d9:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  8010e0:	a8 01                	test   $0x1,%al
  8010e2:	74 11                	je     8010f5 <dup+0x78>
  8010e4:	89 d8                	mov    %ebx,%eax
  8010e6:	c1 e8 0c             	shr    $0xc,%eax
  8010e9:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  8010f0:	f6 c2 01             	test   $0x1,%dl
  8010f3:	75 39                	jne    80112e <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  8010f5:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  8010f8:	89 d0                	mov    %edx,%eax
  8010fa:	c1 e8 0c             	shr    $0xc,%eax
  8010fd:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801104:	83 ec 0c             	sub    $0xc,%esp
  801107:	25 07 0e 00 00       	and    $0xe07,%eax
  80110c:	50                   	push   %eax
  80110d:	56                   	push   %esi
  80110e:	6a 00                	push   $0x0
  801110:	52                   	push   %edx
  801111:	6a 00                	push   $0x0
  801113:	e8 83 fb ff ff       	call   800c9b <sys_page_map>
  801118:	89 c3                	mov    %eax,%ebx
  80111a:	83 c4 20             	add    $0x20,%esp
  80111d:	85 c0                	test   %eax,%eax
  80111f:	78 31                	js     801152 <dup+0xd5>
		goto err;

	return newfdnum;
  801121:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  801124:	89 d8                	mov    %ebx,%eax
  801126:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801129:	5b                   	pop    %ebx
  80112a:	5e                   	pop    %esi
  80112b:	5f                   	pop    %edi
  80112c:	5d                   	pop    %ebp
  80112d:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  80112e:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801135:	83 ec 0c             	sub    $0xc,%esp
  801138:	25 07 0e 00 00       	and    $0xe07,%eax
  80113d:	50                   	push   %eax
  80113e:	57                   	push   %edi
  80113f:	6a 00                	push   $0x0
  801141:	53                   	push   %ebx
  801142:	6a 00                	push   $0x0
  801144:	e8 52 fb ff ff       	call   800c9b <sys_page_map>
  801149:	89 c3                	mov    %eax,%ebx
  80114b:	83 c4 20             	add    $0x20,%esp
  80114e:	85 c0                	test   %eax,%eax
  801150:	79 a3                	jns    8010f5 <dup+0x78>
	sys_page_unmap(0, newfd);
  801152:	83 ec 08             	sub    $0x8,%esp
  801155:	56                   	push   %esi
  801156:	6a 00                	push   $0x0
  801158:	e8 84 fb ff ff       	call   800ce1 <sys_page_unmap>
	sys_page_unmap(0, nva);
  80115d:	83 c4 08             	add    $0x8,%esp
  801160:	57                   	push   %edi
  801161:	6a 00                	push   $0x0
  801163:	e8 79 fb ff ff       	call   800ce1 <sys_page_unmap>
	return r;
  801168:	83 c4 10             	add    $0x10,%esp
  80116b:	eb b7                	jmp    801124 <dup+0xa7>

0080116d <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  80116d:	f3 0f 1e fb          	endbr32 
  801171:	55                   	push   %ebp
  801172:	89 e5                	mov    %esp,%ebp
  801174:	53                   	push   %ebx
  801175:	83 ec 1c             	sub    $0x1c,%esp
  801178:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  80117b:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80117e:	50                   	push   %eax
  80117f:	53                   	push   %ebx
  801180:	e8 65 fd ff ff       	call   800eea <fd_lookup>
  801185:	83 c4 10             	add    $0x10,%esp
  801188:	85 c0                	test   %eax,%eax
  80118a:	78 3f                	js     8011cb <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80118c:	83 ec 08             	sub    $0x8,%esp
  80118f:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801192:	50                   	push   %eax
  801193:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801196:	ff 30                	pushl  (%eax)
  801198:	e8 a1 fd ff ff       	call   800f3e <dev_lookup>
  80119d:	83 c4 10             	add    $0x10,%esp
  8011a0:	85 c0                	test   %eax,%eax
  8011a2:	78 27                	js     8011cb <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8011a4:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8011a7:	8b 42 08             	mov    0x8(%edx),%eax
  8011aa:	83 e0 03             	and    $0x3,%eax
  8011ad:	83 f8 01             	cmp    $0x1,%eax
  8011b0:	74 1e                	je     8011d0 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  8011b2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8011b5:	8b 40 08             	mov    0x8(%eax),%eax
  8011b8:	85 c0                	test   %eax,%eax
  8011ba:	74 35                	je     8011f1 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  8011bc:	83 ec 04             	sub    $0x4,%esp
  8011bf:	ff 75 10             	pushl  0x10(%ebp)
  8011c2:	ff 75 0c             	pushl  0xc(%ebp)
  8011c5:	52                   	push   %edx
  8011c6:	ff d0                	call   *%eax
  8011c8:	83 c4 10             	add    $0x10,%esp
}
  8011cb:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8011ce:	c9                   	leave  
  8011cf:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  8011d0:	a1 20 40 c0 00       	mov    0xc04020,%eax
  8011d5:	8b 40 48             	mov    0x48(%eax),%eax
  8011d8:	83 ec 04             	sub    $0x4,%esp
  8011db:	53                   	push   %ebx
  8011dc:	50                   	push   %eax
  8011dd:	68 ad 23 80 00       	push   $0x8023ad
  8011e2:	e8 52 f0 ff ff       	call   800239 <cprintf>
		return -E_INVAL;
  8011e7:	83 c4 10             	add    $0x10,%esp
  8011ea:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8011ef:	eb da                	jmp    8011cb <read+0x5e>
		return -E_NOT_SUPP;
  8011f1:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8011f6:	eb d3                	jmp    8011cb <read+0x5e>

008011f8 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  8011f8:	f3 0f 1e fb          	endbr32 
  8011fc:	55                   	push   %ebp
  8011fd:	89 e5                	mov    %esp,%ebp
  8011ff:	57                   	push   %edi
  801200:	56                   	push   %esi
  801201:	53                   	push   %ebx
  801202:	83 ec 0c             	sub    $0xc,%esp
  801205:	8b 7d 08             	mov    0x8(%ebp),%edi
  801208:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  80120b:	bb 00 00 00 00       	mov    $0x0,%ebx
  801210:	eb 02                	jmp    801214 <readn+0x1c>
  801212:	01 c3                	add    %eax,%ebx
  801214:	39 f3                	cmp    %esi,%ebx
  801216:	73 21                	jae    801239 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801218:	83 ec 04             	sub    $0x4,%esp
  80121b:	89 f0                	mov    %esi,%eax
  80121d:	29 d8                	sub    %ebx,%eax
  80121f:	50                   	push   %eax
  801220:	89 d8                	mov    %ebx,%eax
  801222:	03 45 0c             	add    0xc(%ebp),%eax
  801225:	50                   	push   %eax
  801226:	57                   	push   %edi
  801227:	e8 41 ff ff ff       	call   80116d <read>
		if (m < 0)
  80122c:	83 c4 10             	add    $0x10,%esp
  80122f:	85 c0                	test   %eax,%eax
  801231:	78 04                	js     801237 <readn+0x3f>
			return m;
		if (m == 0)
  801233:	75 dd                	jne    801212 <readn+0x1a>
  801235:	eb 02                	jmp    801239 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801237:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  801239:	89 d8                	mov    %ebx,%eax
  80123b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80123e:	5b                   	pop    %ebx
  80123f:	5e                   	pop    %esi
  801240:	5f                   	pop    %edi
  801241:	5d                   	pop    %ebp
  801242:	c3                   	ret    

00801243 <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  801243:	f3 0f 1e fb          	endbr32 
  801247:	55                   	push   %ebp
  801248:	89 e5                	mov    %esp,%ebp
  80124a:	53                   	push   %ebx
  80124b:	83 ec 1c             	sub    $0x1c,%esp
  80124e:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  801251:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801254:	50                   	push   %eax
  801255:	53                   	push   %ebx
  801256:	e8 8f fc ff ff       	call   800eea <fd_lookup>
  80125b:	83 c4 10             	add    $0x10,%esp
  80125e:	85 c0                	test   %eax,%eax
  801260:	78 3a                	js     80129c <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  801262:	83 ec 08             	sub    $0x8,%esp
  801265:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801268:	50                   	push   %eax
  801269:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80126c:	ff 30                	pushl  (%eax)
  80126e:	e8 cb fc ff ff       	call   800f3e <dev_lookup>
  801273:	83 c4 10             	add    $0x10,%esp
  801276:	85 c0                	test   %eax,%eax
  801278:	78 22                	js     80129c <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  80127a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80127d:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  801281:	74 1e                	je     8012a1 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  801283:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801286:	8b 52 0c             	mov    0xc(%edx),%edx
  801289:	85 d2                	test   %edx,%edx
  80128b:	74 35                	je     8012c2 <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  80128d:	83 ec 04             	sub    $0x4,%esp
  801290:	ff 75 10             	pushl  0x10(%ebp)
  801293:	ff 75 0c             	pushl  0xc(%ebp)
  801296:	50                   	push   %eax
  801297:	ff d2                	call   *%edx
  801299:	83 c4 10             	add    $0x10,%esp
}
  80129c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80129f:	c9                   	leave  
  8012a0:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  8012a1:	a1 20 40 c0 00       	mov    0xc04020,%eax
  8012a6:	8b 40 48             	mov    0x48(%eax),%eax
  8012a9:	83 ec 04             	sub    $0x4,%esp
  8012ac:	53                   	push   %ebx
  8012ad:	50                   	push   %eax
  8012ae:	68 c9 23 80 00       	push   $0x8023c9
  8012b3:	e8 81 ef ff ff       	call   800239 <cprintf>
		return -E_INVAL;
  8012b8:	83 c4 10             	add    $0x10,%esp
  8012bb:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8012c0:	eb da                	jmp    80129c <write+0x59>
		return -E_NOT_SUPP;
  8012c2:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8012c7:	eb d3                	jmp    80129c <write+0x59>

008012c9 <seek>:

int
seek(int fdnum, off_t offset)
{
  8012c9:	f3 0f 1e fb          	endbr32 
  8012cd:	55                   	push   %ebp
  8012ce:	89 e5                	mov    %esp,%ebp
  8012d0:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8012d3:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012d6:	50                   	push   %eax
  8012d7:	ff 75 08             	pushl  0x8(%ebp)
  8012da:	e8 0b fc ff ff       	call   800eea <fd_lookup>
  8012df:	83 c4 10             	add    $0x10,%esp
  8012e2:	85 c0                	test   %eax,%eax
  8012e4:	78 0e                	js     8012f4 <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  8012e6:	8b 55 0c             	mov    0xc(%ebp),%edx
  8012e9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8012ec:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  8012ef:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8012f4:	c9                   	leave  
  8012f5:	c3                   	ret    

008012f6 <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  8012f6:	f3 0f 1e fb          	endbr32 
  8012fa:	55                   	push   %ebp
  8012fb:	89 e5                	mov    %esp,%ebp
  8012fd:	53                   	push   %ebx
  8012fe:	83 ec 1c             	sub    $0x1c,%esp
  801301:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  801304:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801307:	50                   	push   %eax
  801308:	53                   	push   %ebx
  801309:	e8 dc fb ff ff       	call   800eea <fd_lookup>
  80130e:	83 c4 10             	add    $0x10,%esp
  801311:	85 c0                	test   %eax,%eax
  801313:	78 37                	js     80134c <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  801315:	83 ec 08             	sub    $0x8,%esp
  801318:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80131b:	50                   	push   %eax
  80131c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80131f:	ff 30                	pushl  (%eax)
  801321:	e8 18 fc ff ff       	call   800f3e <dev_lookup>
  801326:	83 c4 10             	add    $0x10,%esp
  801329:	85 c0                	test   %eax,%eax
  80132b:	78 1f                	js     80134c <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  80132d:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801330:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  801334:	74 1b                	je     801351 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  801336:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801339:	8b 52 18             	mov    0x18(%edx),%edx
  80133c:	85 d2                	test   %edx,%edx
  80133e:	74 32                	je     801372 <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  801340:	83 ec 08             	sub    $0x8,%esp
  801343:	ff 75 0c             	pushl  0xc(%ebp)
  801346:	50                   	push   %eax
  801347:	ff d2                	call   *%edx
  801349:	83 c4 10             	add    $0x10,%esp
}
  80134c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80134f:	c9                   	leave  
  801350:	c3                   	ret    
			thisenv->env_id, fdnum);
  801351:	a1 20 40 c0 00       	mov    0xc04020,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  801356:	8b 40 48             	mov    0x48(%eax),%eax
  801359:	83 ec 04             	sub    $0x4,%esp
  80135c:	53                   	push   %ebx
  80135d:	50                   	push   %eax
  80135e:	68 8c 23 80 00       	push   $0x80238c
  801363:	e8 d1 ee ff ff       	call   800239 <cprintf>
		return -E_INVAL;
  801368:	83 c4 10             	add    $0x10,%esp
  80136b:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801370:	eb da                	jmp    80134c <ftruncate+0x56>
		return -E_NOT_SUPP;
  801372:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801377:	eb d3                	jmp    80134c <ftruncate+0x56>

00801379 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  801379:	f3 0f 1e fb          	endbr32 
  80137d:	55                   	push   %ebp
  80137e:	89 e5                	mov    %esp,%ebp
  801380:	53                   	push   %ebx
  801381:	83 ec 1c             	sub    $0x1c,%esp
  801384:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  801387:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80138a:	50                   	push   %eax
  80138b:	ff 75 08             	pushl  0x8(%ebp)
  80138e:	e8 57 fb ff ff       	call   800eea <fd_lookup>
  801393:	83 c4 10             	add    $0x10,%esp
  801396:	85 c0                	test   %eax,%eax
  801398:	78 4b                	js     8013e5 <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80139a:	83 ec 08             	sub    $0x8,%esp
  80139d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8013a0:	50                   	push   %eax
  8013a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8013a4:	ff 30                	pushl  (%eax)
  8013a6:	e8 93 fb ff ff       	call   800f3e <dev_lookup>
  8013ab:	83 c4 10             	add    $0x10,%esp
  8013ae:	85 c0                	test   %eax,%eax
  8013b0:	78 33                	js     8013e5 <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  8013b2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8013b5:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  8013b9:	74 2f                	je     8013ea <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  8013bb:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  8013be:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  8013c5:	00 00 00 
	stat->st_isdir = 0;
  8013c8:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  8013cf:	00 00 00 
	stat->st_dev = dev;
  8013d2:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  8013d8:	83 ec 08             	sub    $0x8,%esp
  8013db:	53                   	push   %ebx
  8013dc:	ff 75 f0             	pushl  -0x10(%ebp)
  8013df:	ff 50 14             	call   *0x14(%eax)
  8013e2:	83 c4 10             	add    $0x10,%esp
}
  8013e5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8013e8:	c9                   	leave  
  8013e9:	c3                   	ret    
		return -E_NOT_SUPP;
  8013ea:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8013ef:	eb f4                	jmp    8013e5 <fstat+0x6c>

008013f1 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  8013f1:	f3 0f 1e fb          	endbr32 
  8013f5:	55                   	push   %ebp
  8013f6:	89 e5                	mov    %esp,%ebp
  8013f8:	56                   	push   %esi
  8013f9:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  8013fa:	83 ec 08             	sub    $0x8,%esp
  8013fd:	6a 00                	push   $0x0
  8013ff:	ff 75 08             	pushl  0x8(%ebp)
  801402:	e8 fb 01 00 00       	call   801602 <open>
  801407:	89 c3                	mov    %eax,%ebx
  801409:	83 c4 10             	add    $0x10,%esp
  80140c:	85 c0                	test   %eax,%eax
  80140e:	78 1b                	js     80142b <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  801410:	83 ec 08             	sub    $0x8,%esp
  801413:	ff 75 0c             	pushl  0xc(%ebp)
  801416:	50                   	push   %eax
  801417:	e8 5d ff ff ff       	call   801379 <fstat>
  80141c:	89 c6                	mov    %eax,%esi
	close(fd);
  80141e:	89 1c 24             	mov    %ebx,(%esp)
  801421:	e8 fd fb ff ff       	call   801023 <close>
	return r;
  801426:	83 c4 10             	add    $0x10,%esp
  801429:	89 f3                	mov    %esi,%ebx
}
  80142b:	89 d8                	mov    %ebx,%eax
  80142d:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801430:	5b                   	pop    %ebx
  801431:	5e                   	pop    %esi
  801432:	5d                   	pop    %ebp
  801433:	c3                   	ret    

00801434 <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  801434:	55                   	push   %ebp
  801435:	89 e5                	mov    %esp,%ebp
  801437:	56                   	push   %esi
  801438:	53                   	push   %ebx
  801439:	89 c6                	mov    %eax,%esi
  80143b:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  80143d:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  801444:	74 27                	je     80146d <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  801446:	6a 07                	push   $0x7
  801448:	68 00 50 c0 00       	push   $0xc05000
  80144d:	56                   	push   %esi
  80144e:	ff 35 00 40 80 00    	pushl  0x804000
  801454:	e8 d2 07 00 00       	call   801c2b <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  801459:	83 c4 0c             	add    $0xc,%esp
  80145c:	6a 00                	push   $0x0
  80145e:	53                   	push   %ebx
  80145f:	6a 00                	push   $0x0
  801461:	e8 44 07 00 00       	call   801baa <ipc_recv>
}
  801466:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801469:	5b                   	pop    %ebx
  80146a:	5e                   	pop    %esi
  80146b:	5d                   	pop    %ebp
  80146c:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  80146d:	83 ec 0c             	sub    $0xc,%esp
  801470:	6a 01                	push   $0x1
  801472:	e8 0c 08 00 00       	call   801c83 <ipc_find_env>
  801477:	a3 00 40 80 00       	mov    %eax,0x804000
  80147c:	83 c4 10             	add    $0x10,%esp
  80147f:	eb c5                	jmp    801446 <fsipc+0x12>

00801481 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  801481:	f3 0f 1e fb          	endbr32 
  801485:	55                   	push   %ebp
  801486:	89 e5                	mov    %esp,%ebp
  801488:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  80148b:	8b 45 08             	mov    0x8(%ebp),%eax
  80148e:	8b 40 0c             	mov    0xc(%eax),%eax
  801491:	a3 00 50 c0 00       	mov    %eax,0xc05000
	fsipcbuf.set_size.req_size = newsize;
  801496:	8b 45 0c             	mov    0xc(%ebp),%eax
  801499:	a3 04 50 c0 00       	mov    %eax,0xc05004
	return fsipc(FSREQ_SET_SIZE, NULL);
  80149e:	ba 00 00 00 00       	mov    $0x0,%edx
  8014a3:	b8 02 00 00 00       	mov    $0x2,%eax
  8014a8:	e8 87 ff ff ff       	call   801434 <fsipc>
}
  8014ad:	c9                   	leave  
  8014ae:	c3                   	ret    

008014af <devfile_flush>:
{
  8014af:	f3 0f 1e fb          	endbr32 
  8014b3:	55                   	push   %ebp
  8014b4:	89 e5                	mov    %esp,%ebp
  8014b6:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  8014b9:	8b 45 08             	mov    0x8(%ebp),%eax
  8014bc:	8b 40 0c             	mov    0xc(%eax),%eax
  8014bf:	a3 00 50 c0 00       	mov    %eax,0xc05000
	return fsipc(FSREQ_FLUSH, NULL);
  8014c4:	ba 00 00 00 00       	mov    $0x0,%edx
  8014c9:	b8 06 00 00 00       	mov    $0x6,%eax
  8014ce:	e8 61 ff ff ff       	call   801434 <fsipc>
}
  8014d3:	c9                   	leave  
  8014d4:	c3                   	ret    

008014d5 <devfile_stat>:
{
  8014d5:	f3 0f 1e fb          	endbr32 
  8014d9:	55                   	push   %ebp
  8014da:	89 e5                	mov    %esp,%ebp
  8014dc:	53                   	push   %ebx
  8014dd:	83 ec 04             	sub    $0x4,%esp
  8014e0:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  8014e3:	8b 45 08             	mov    0x8(%ebp),%eax
  8014e6:	8b 40 0c             	mov    0xc(%eax),%eax
  8014e9:	a3 00 50 c0 00       	mov    %eax,0xc05000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  8014ee:	ba 00 00 00 00       	mov    $0x0,%edx
  8014f3:	b8 05 00 00 00       	mov    $0x5,%eax
  8014f8:	e8 37 ff ff ff       	call   801434 <fsipc>
  8014fd:	85 c0                	test   %eax,%eax
  8014ff:	78 2c                	js     80152d <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  801501:	83 ec 08             	sub    $0x8,%esp
  801504:	68 00 50 c0 00       	push   $0xc05000
  801509:	53                   	push   %ebx
  80150a:	e8 03 f3 ff ff       	call   800812 <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  80150f:	a1 80 50 c0 00       	mov    0xc05080,%eax
  801514:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  80151a:	a1 84 50 c0 00       	mov    0xc05084,%eax
  80151f:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  801525:	83 c4 10             	add    $0x10,%esp
  801528:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80152d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801530:	c9                   	leave  
  801531:	c3                   	ret    

00801532 <devfile_write>:
{
  801532:	f3 0f 1e fb          	endbr32 
  801536:	55                   	push   %ebp
  801537:	89 e5                	mov    %esp,%ebp
  801539:	83 ec 0c             	sub    $0xc,%esp
  80153c:	8b 45 10             	mov    0x10(%ebp),%eax
  80153f:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  801544:	ba f8 0f 00 00       	mov    $0xff8,%edx
  801549:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  80154c:	8b 55 08             	mov    0x8(%ebp),%edx
  80154f:	8b 52 0c             	mov    0xc(%edx),%edx
  801552:	89 15 00 50 c0 00    	mov    %edx,0xc05000
	fsipcbuf.write.req_n = n;
  801558:	a3 04 50 c0 00       	mov    %eax,0xc05004
	memmove(fsipcbuf.write.req_buf, buf, n);
  80155d:	50                   	push   %eax
  80155e:	ff 75 0c             	pushl  0xc(%ebp)
  801561:	68 08 50 c0 00       	push   $0xc05008
  801566:	e8 5d f4 ff ff       	call   8009c8 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  80156b:	ba 00 00 00 00       	mov    $0x0,%edx
  801570:	b8 04 00 00 00       	mov    $0x4,%eax
  801575:	e8 ba fe ff ff       	call   801434 <fsipc>
  80157a:	c9                   	leave  
  80157b:	c3                   	ret    

0080157c <devfile_read>:
{
  80157c:	f3 0f 1e fb          	endbr32 
  801580:	55                   	push   %ebp
  801581:	89 e5                	mov    %esp,%ebp
  801583:	56                   	push   %esi
  801584:	53                   	push   %ebx
  801585:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  801588:	8b 45 08             	mov    0x8(%ebp),%eax
  80158b:	8b 40 0c             	mov    0xc(%eax),%eax
  80158e:	a3 00 50 c0 00       	mov    %eax,0xc05000
	fsipcbuf.read.req_n = n;
  801593:	89 35 04 50 c0 00    	mov    %esi,0xc05004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  801599:	ba 00 00 00 00       	mov    $0x0,%edx
  80159e:	b8 03 00 00 00       	mov    $0x3,%eax
  8015a3:	e8 8c fe ff ff       	call   801434 <fsipc>
  8015a8:	89 c3                	mov    %eax,%ebx
  8015aa:	85 c0                	test   %eax,%eax
  8015ac:	78 1f                	js     8015cd <devfile_read+0x51>
	assert(r <= n);
  8015ae:	39 f0                	cmp    %esi,%eax
  8015b0:	77 24                	ja     8015d6 <devfile_read+0x5a>
	assert(r <= PGSIZE);
  8015b2:	3d 00 10 00 00       	cmp    $0x1000,%eax
  8015b7:	7f 33                	jg     8015ec <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  8015b9:	83 ec 04             	sub    $0x4,%esp
  8015bc:	50                   	push   %eax
  8015bd:	68 00 50 c0 00       	push   $0xc05000
  8015c2:	ff 75 0c             	pushl  0xc(%ebp)
  8015c5:	e8 fe f3 ff ff       	call   8009c8 <memmove>
	return r;
  8015ca:	83 c4 10             	add    $0x10,%esp
}
  8015cd:	89 d8                	mov    %ebx,%eax
  8015cf:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8015d2:	5b                   	pop    %ebx
  8015d3:	5e                   	pop    %esi
  8015d4:	5d                   	pop    %ebp
  8015d5:	c3                   	ret    
	assert(r <= n);
  8015d6:	68 f8 23 80 00       	push   $0x8023f8
  8015db:	68 ff 23 80 00       	push   $0x8023ff
  8015e0:	6a 7c                	push   $0x7c
  8015e2:	68 14 24 80 00       	push   $0x802414
  8015e7:	e8 66 eb ff ff       	call   800152 <_panic>
	assert(r <= PGSIZE);
  8015ec:	68 1f 24 80 00       	push   $0x80241f
  8015f1:	68 ff 23 80 00       	push   $0x8023ff
  8015f6:	6a 7d                	push   $0x7d
  8015f8:	68 14 24 80 00       	push   $0x802414
  8015fd:	e8 50 eb ff ff       	call   800152 <_panic>

00801602 <open>:
{
  801602:	f3 0f 1e fb          	endbr32 
  801606:	55                   	push   %ebp
  801607:	89 e5                	mov    %esp,%ebp
  801609:	56                   	push   %esi
  80160a:	53                   	push   %ebx
  80160b:	83 ec 1c             	sub    $0x1c,%esp
  80160e:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  801611:	56                   	push   %esi
  801612:	e8 b8 f1 ff ff       	call   8007cf <strlen>
  801617:	83 c4 10             	add    $0x10,%esp
  80161a:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  80161f:	7f 6c                	jg     80168d <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  801621:	83 ec 0c             	sub    $0xc,%esp
  801624:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801627:	50                   	push   %eax
  801628:	e8 67 f8 ff ff       	call   800e94 <fd_alloc>
  80162d:	89 c3                	mov    %eax,%ebx
  80162f:	83 c4 10             	add    $0x10,%esp
  801632:	85 c0                	test   %eax,%eax
  801634:	78 3c                	js     801672 <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  801636:	83 ec 08             	sub    $0x8,%esp
  801639:	56                   	push   %esi
  80163a:	68 00 50 c0 00       	push   $0xc05000
  80163f:	e8 ce f1 ff ff       	call   800812 <strcpy>
	fsipcbuf.open.req_omode = mode;
  801644:	8b 45 0c             	mov    0xc(%ebp),%eax
  801647:	a3 00 54 c0 00       	mov    %eax,0xc05400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  80164c:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80164f:	b8 01 00 00 00       	mov    $0x1,%eax
  801654:	e8 db fd ff ff       	call   801434 <fsipc>
  801659:	89 c3                	mov    %eax,%ebx
  80165b:	83 c4 10             	add    $0x10,%esp
  80165e:	85 c0                	test   %eax,%eax
  801660:	78 19                	js     80167b <open+0x79>
	return fd2num(fd);
  801662:	83 ec 0c             	sub    $0xc,%esp
  801665:	ff 75 f4             	pushl  -0xc(%ebp)
  801668:	e8 f8 f7 ff ff       	call   800e65 <fd2num>
  80166d:	89 c3                	mov    %eax,%ebx
  80166f:	83 c4 10             	add    $0x10,%esp
}
  801672:	89 d8                	mov    %ebx,%eax
  801674:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801677:	5b                   	pop    %ebx
  801678:	5e                   	pop    %esi
  801679:	5d                   	pop    %ebp
  80167a:	c3                   	ret    
		fd_close(fd, 0);
  80167b:	83 ec 08             	sub    $0x8,%esp
  80167e:	6a 00                	push   $0x0
  801680:	ff 75 f4             	pushl  -0xc(%ebp)
  801683:	e8 10 f9 ff ff       	call   800f98 <fd_close>
		return r;
  801688:	83 c4 10             	add    $0x10,%esp
  80168b:	eb e5                	jmp    801672 <open+0x70>
		return -E_BAD_PATH;
  80168d:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  801692:	eb de                	jmp    801672 <open+0x70>

00801694 <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  801694:	f3 0f 1e fb          	endbr32 
  801698:	55                   	push   %ebp
  801699:	89 e5                	mov    %esp,%ebp
  80169b:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  80169e:	ba 00 00 00 00       	mov    $0x0,%edx
  8016a3:	b8 08 00 00 00       	mov    $0x8,%eax
  8016a8:	e8 87 fd ff ff       	call   801434 <fsipc>
}
  8016ad:	c9                   	leave  
  8016ae:	c3                   	ret    

008016af <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  8016af:	f3 0f 1e fb          	endbr32 
  8016b3:	55                   	push   %ebp
  8016b4:	89 e5                	mov    %esp,%ebp
  8016b6:	56                   	push   %esi
  8016b7:	53                   	push   %ebx
  8016b8:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  8016bb:	83 ec 0c             	sub    $0xc,%esp
  8016be:	ff 75 08             	pushl  0x8(%ebp)
  8016c1:	e8 b3 f7 ff ff       	call   800e79 <fd2data>
  8016c6:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  8016c8:	83 c4 08             	add    $0x8,%esp
  8016cb:	68 2b 24 80 00       	push   $0x80242b
  8016d0:	53                   	push   %ebx
  8016d1:	e8 3c f1 ff ff       	call   800812 <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  8016d6:	8b 46 04             	mov    0x4(%esi),%eax
  8016d9:	2b 06                	sub    (%esi),%eax
  8016db:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  8016e1:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  8016e8:	00 00 00 
	stat->st_dev = &devpipe;
  8016eb:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  8016f2:	30 80 00 
	return 0;
}
  8016f5:	b8 00 00 00 00       	mov    $0x0,%eax
  8016fa:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8016fd:	5b                   	pop    %ebx
  8016fe:	5e                   	pop    %esi
  8016ff:	5d                   	pop    %ebp
  801700:	c3                   	ret    

00801701 <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801701:	f3 0f 1e fb          	endbr32 
  801705:	55                   	push   %ebp
  801706:	89 e5                	mov    %esp,%ebp
  801708:	53                   	push   %ebx
  801709:	83 ec 0c             	sub    $0xc,%esp
  80170c:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  80170f:	53                   	push   %ebx
  801710:	6a 00                	push   $0x0
  801712:	e8 ca f5 ff ff       	call   800ce1 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  801717:	89 1c 24             	mov    %ebx,(%esp)
  80171a:	e8 5a f7 ff ff       	call   800e79 <fd2data>
  80171f:	83 c4 08             	add    $0x8,%esp
  801722:	50                   	push   %eax
  801723:	6a 00                	push   $0x0
  801725:	e8 b7 f5 ff ff       	call   800ce1 <sys_page_unmap>
}
  80172a:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80172d:	c9                   	leave  
  80172e:	c3                   	ret    

0080172f <_pipeisclosed>:
{
  80172f:	55                   	push   %ebp
  801730:	89 e5                	mov    %esp,%ebp
  801732:	57                   	push   %edi
  801733:	56                   	push   %esi
  801734:	53                   	push   %ebx
  801735:	83 ec 1c             	sub    $0x1c,%esp
  801738:	89 c7                	mov    %eax,%edi
  80173a:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  80173c:	a1 20 40 c0 00       	mov    0xc04020,%eax
  801741:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  801744:	83 ec 0c             	sub    $0xc,%esp
  801747:	57                   	push   %edi
  801748:	e8 73 05 00 00       	call   801cc0 <pageref>
  80174d:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801750:	89 34 24             	mov    %esi,(%esp)
  801753:	e8 68 05 00 00       	call   801cc0 <pageref>
		nn = thisenv->env_runs;
  801758:	8b 15 20 40 c0 00    	mov    0xc04020,%edx
  80175e:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  801761:	83 c4 10             	add    $0x10,%esp
  801764:	39 cb                	cmp    %ecx,%ebx
  801766:	74 1b                	je     801783 <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  801768:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  80176b:	75 cf                	jne    80173c <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  80176d:	8b 42 58             	mov    0x58(%edx),%eax
  801770:	6a 01                	push   $0x1
  801772:	50                   	push   %eax
  801773:	53                   	push   %ebx
  801774:	68 32 24 80 00       	push   $0x802432
  801779:	e8 bb ea ff ff       	call   800239 <cprintf>
  80177e:	83 c4 10             	add    $0x10,%esp
  801781:	eb b9                	jmp    80173c <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  801783:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801786:	0f 94 c0             	sete   %al
  801789:	0f b6 c0             	movzbl %al,%eax
}
  80178c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80178f:	5b                   	pop    %ebx
  801790:	5e                   	pop    %esi
  801791:	5f                   	pop    %edi
  801792:	5d                   	pop    %ebp
  801793:	c3                   	ret    

00801794 <devpipe_write>:
{
  801794:	f3 0f 1e fb          	endbr32 
  801798:	55                   	push   %ebp
  801799:	89 e5                	mov    %esp,%ebp
  80179b:	57                   	push   %edi
  80179c:	56                   	push   %esi
  80179d:	53                   	push   %ebx
  80179e:	83 ec 28             	sub    $0x28,%esp
  8017a1:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  8017a4:	56                   	push   %esi
  8017a5:	e8 cf f6 ff ff       	call   800e79 <fd2data>
  8017aa:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8017ac:	83 c4 10             	add    $0x10,%esp
  8017af:	bf 00 00 00 00       	mov    $0x0,%edi
  8017b4:	3b 7d 10             	cmp    0x10(%ebp),%edi
  8017b7:	74 4f                	je     801808 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  8017b9:	8b 43 04             	mov    0x4(%ebx),%eax
  8017bc:	8b 0b                	mov    (%ebx),%ecx
  8017be:	8d 51 20             	lea    0x20(%ecx),%edx
  8017c1:	39 d0                	cmp    %edx,%eax
  8017c3:	72 14                	jb     8017d9 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  8017c5:	89 da                	mov    %ebx,%edx
  8017c7:	89 f0                	mov    %esi,%eax
  8017c9:	e8 61 ff ff ff       	call   80172f <_pipeisclosed>
  8017ce:	85 c0                	test   %eax,%eax
  8017d0:	75 3b                	jne    80180d <devpipe_write+0x79>
			sys_yield();
  8017d2:	e8 5a f4 ff ff       	call   800c31 <sys_yield>
  8017d7:	eb e0                	jmp    8017b9 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  8017d9:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8017dc:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  8017e0:	88 4d e7             	mov    %cl,-0x19(%ebp)
  8017e3:	89 c2                	mov    %eax,%edx
  8017e5:	c1 fa 1f             	sar    $0x1f,%edx
  8017e8:	89 d1                	mov    %edx,%ecx
  8017ea:	c1 e9 1b             	shr    $0x1b,%ecx
  8017ed:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  8017f0:	83 e2 1f             	and    $0x1f,%edx
  8017f3:	29 ca                	sub    %ecx,%edx
  8017f5:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  8017f9:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  8017fd:	83 c0 01             	add    $0x1,%eax
  801800:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  801803:	83 c7 01             	add    $0x1,%edi
  801806:	eb ac                	jmp    8017b4 <devpipe_write+0x20>
	return i;
  801808:	8b 45 10             	mov    0x10(%ebp),%eax
  80180b:	eb 05                	jmp    801812 <devpipe_write+0x7e>
				return 0;
  80180d:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801812:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801815:	5b                   	pop    %ebx
  801816:	5e                   	pop    %esi
  801817:	5f                   	pop    %edi
  801818:	5d                   	pop    %ebp
  801819:	c3                   	ret    

0080181a <devpipe_read>:
{
  80181a:	f3 0f 1e fb          	endbr32 
  80181e:	55                   	push   %ebp
  80181f:	89 e5                	mov    %esp,%ebp
  801821:	57                   	push   %edi
  801822:	56                   	push   %esi
  801823:	53                   	push   %ebx
  801824:	83 ec 18             	sub    $0x18,%esp
  801827:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  80182a:	57                   	push   %edi
  80182b:	e8 49 f6 ff ff       	call   800e79 <fd2data>
  801830:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  801832:	83 c4 10             	add    $0x10,%esp
  801835:	be 00 00 00 00       	mov    $0x0,%esi
  80183a:	3b 75 10             	cmp    0x10(%ebp),%esi
  80183d:	75 14                	jne    801853 <devpipe_read+0x39>
	return i;
  80183f:	8b 45 10             	mov    0x10(%ebp),%eax
  801842:	eb 02                	jmp    801846 <devpipe_read+0x2c>
				return i;
  801844:	89 f0                	mov    %esi,%eax
}
  801846:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801849:	5b                   	pop    %ebx
  80184a:	5e                   	pop    %esi
  80184b:	5f                   	pop    %edi
  80184c:	5d                   	pop    %ebp
  80184d:	c3                   	ret    
			sys_yield();
  80184e:	e8 de f3 ff ff       	call   800c31 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  801853:	8b 03                	mov    (%ebx),%eax
  801855:	3b 43 04             	cmp    0x4(%ebx),%eax
  801858:	75 18                	jne    801872 <devpipe_read+0x58>
			if (i > 0)
  80185a:	85 f6                	test   %esi,%esi
  80185c:	75 e6                	jne    801844 <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  80185e:	89 da                	mov    %ebx,%edx
  801860:	89 f8                	mov    %edi,%eax
  801862:	e8 c8 fe ff ff       	call   80172f <_pipeisclosed>
  801867:	85 c0                	test   %eax,%eax
  801869:	74 e3                	je     80184e <devpipe_read+0x34>
				return 0;
  80186b:	b8 00 00 00 00       	mov    $0x0,%eax
  801870:	eb d4                	jmp    801846 <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  801872:	99                   	cltd   
  801873:	c1 ea 1b             	shr    $0x1b,%edx
  801876:	01 d0                	add    %edx,%eax
  801878:	83 e0 1f             	and    $0x1f,%eax
  80187b:	29 d0                	sub    %edx,%eax
  80187d:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  801882:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801885:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  801888:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  80188b:	83 c6 01             	add    $0x1,%esi
  80188e:	eb aa                	jmp    80183a <devpipe_read+0x20>

00801890 <pipe>:
{
  801890:	f3 0f 1e fb          	endbr32 
  801894:	55                   	push   %ebp
  801895:	89 e5                	mov    %esp,%ebp
  801897:	56                   	push   %esi
  801898:	53                   	push   %ebx
  801899:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  80189c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80189f:	50                   	push   %eax
  8018a0:	e8 ef f5 ff ff       	call   800e94 <fd_alloc>
  8018a5:	89 c3                	mov    %eax,%ebx
  8018a7:	83 c4 10             	add    $0x10,%esp
  8018aa:	85 c0                	test   %eax,%eax
  8018ac:	0f 88 23 01 00 00    	js     8019d5 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8018b2:	83 ec 04             	sub    $0x4,%esp
  8018b5:	68 07 04 00 00       	push   $0x407
  8018ba:	ff 75 f4             	pushl  -0xc(%ebp)
  8018bd:	6a 00                	push   $0x0
  8018bf:	e8 90 f3 ff ff       	call   800c54 <sys_page_alloc>
  8018c4:	89 c3                	mov    %eax,%ebx
  8018c6:	83 c4 10             	add    $0x10,%esp
  8018c9:	85 c0                	test   %eax,%eax
  8018cb:	0f 88 04 01 00 00    	js     8019d5 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  8018d1:	83 ec 0c             	sub    $0xc,%esp
  8018d4:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8018d7:	50                   	push   %eax
  8018d8:	e8 b7 f5 ff ff       	call   800e94 <fd_alloc>
  8018dd:	89 c3                	mov    %eax,%ebx
  8018df:	83 c4 10             	add    $0x10,%esp
  8018e2:	85 c0                	test   %eax,%eax
  8018e4:	0f 88 db 00 00 00    	js     8019c5 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8018ea:	83 ec 04             	sub    $0x4,%esp
  8018ed:	68 07 04 00 00       	push   $0x407
  8018f2:	ff 75 f0             	pushl  -0x10(%ebp)
  8018f5:	6a 00                	push   $0x0
  8018f7:	e8 58 f3 ff ff       	call   800c54 <sys_page_alloc>
  8018fc:	89 c3                	mov    %eax,%ebx
  8018fe:	83 c4 10             	add    $0x10,%esp
  801901:	85 c0                	test   %eax,%eax
  801903:	0f 88 bc 00 00 00    	js     8019c5 <pipe+0x135>
	va = fd2data(fd0);
  801909:	83 ec 0c             	sub    $0xc,%esp
  80190c:	ff 75 f4             	pushl  -0xc(%ebp)
  80190f:	e8 65 f5 ff ff       	call   800e79 <fd2data>
  801914:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801916:	83 c4 0c             	add    $0xc,%esp
  801919:	68 07 04 00 00       	push   $0x407
  80191e:	50                   	push   %eax
  80191f:	6a 00                	push   $0x0
  801921:	e8 2e f3 ff ff       	call   800c54 <sys_page_alloc>
  801926:	89 c3                	mov    %eax,%ebx
  801928:	83 c4 10             	add    $0x10,%esp
  80192b:	85 c0                	test   %eax,%eax
  80192d:	0f 88 82 00 00 00    	js     8019b5 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801933:	83 ec 0c             	sub    $0xc,%esp
  801936:	ff 75 f0             	pushl  -0x10(%ebp)
  801939:	e8 3b f5 ff ff       	call   800e79 <fd2data>
  80193e:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  801945:	50                   	push   %eax
  801946:	6a 00                	push   $0x0
  801948:	56                   	push   %esi
  801949:	6a 00                	push   $0x0
  80194b:	e8 4b f3 ff ff       	call   800c9b <sys_page_map>
  801950:	89 c3                	mov    %eax,%ebx
  801952:	83 c4 20             	add    $0x20,%esp
  801955:	85 c0                	test   %eax,%eax
  801957:	78 4e                	js     8019a7 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  801959:	a1 20 30 80 00       	mov    0x803020,%eax
  80195e:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801961:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  801963:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801966:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  80196d:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801970:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  801972:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801975:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  80197c:	83 ec 0c             	sub    $0xc,%esp
  80197f:	ff 75 f4             	pushl  -0xc(%ebp)
  801982:	e8 de f4 ff ff       	call   800e65 <fd2num>
  801987:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80198a:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  80198c:	83 c4 04             	add    $0x4,%esp
  80198f:	ff 75 f0             	pushl  -0x10(%ebp)
  801992:	e8 ce f4 ff ff       	call   800e65 <fd2num>
  801997:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80199a:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  80199d:	83 c4 10             	add    $0x10,%esp
  8019a0:	bb 00 00 00 00       	mov    $0x0,%ebx
  8019a5:	eb 2e                	jmp    8019d5 <pipe+0x145>
	sys_page_unmap(0, va);
  8019a7:	83 ec 08             	sub    $0x8,%esp
  8019aa:	56                   	push   %esi
  8019ab:	6a 00                	push   $0x0
  8019ad:	e8 2f f3 ff ff       	call   800ce1 <sys_page_unmap>
  8019b2:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  8019b5:	83 ec 08             	sub    $0x8,%esp
  8019b8:	ff 75 f0             	pushl  -0x10(%ebp)
  8019bb:	6a 00                	push   $0x0
  8019bd:	e8 1f f3 ff ff       	call   800ce1 <sys_page_unmap>
  8019c2:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  8019c5:	83 ec 08             	sub    $0x8,%esp
  8019c8:	ff 75 f4             	pushl  -0xc(%ebp)
  8019cb:	6a 00                	push   $0x0
  8019cd:	e8 0f f3 ff ff       	call   800ce1 <sys_page_unmap>
  8019d2:	83 c4 10             	add    $0x10,%esp
}
  8019d5:	89 d8                	mov    %ebx,%eax
  8019d7:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8019da:	5b                   	pop    %ebx
  8019db:	5e                   	pop    %esi
  8019dc:	5d                   	pop    %ebp
  8019dd:	c3                   	ret    

008019de <pipeisclosed>:
{
  8019de:	f3 0f 1e fb          	endbr32 
  8019e2:	55                   	push   %ebp
  8019e3:	89 e5                	mov    %esp,%ebp
  8019e5:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8019e8:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8019eb:	50                   	push   %eax
  8019ec:	ff 75 08             	pushl  0x8(%ebp)
  8019ef:	e8 f6 f4 ff ff       	call   800eea <fd_lookup>
  8019f4:	83 c4 10             	add    $0x10,%esp
  8019f7:	85 c0                	test   %eax,%eax
  8019f9:	78 18                	js     801a13 <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  8019fb:	83 ec 0c             	sub    $0xc,%esp
  8019fe:	ff 75 f4             	pushl  -0xc(%ebp)
  801a01:	e8 73 f4 ff ff       	call   800e79 <fd2data>
  801a06:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801a08:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801a0b:	e8 1f fd ff ff       	call   80172f <_pipeisclosed>
  801a10:	83 c4 10             	add    $0x10,%esp
}
  801a13:	c9                   	leave  
  801a14:	c3                   	ret    

00801a15 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  801a15:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801a19:	b8 00 00 00 00       	mov    $0x0,%eax
  801a1e:	c3                   	ret    

00801a1f <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801a1f:	f3 0f 1e fb          	endbr32 
  801a23:	55                   	push   %ebp
  801a24:	89 e5                	mov    %esp,%ebp
  801a26:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801a29:	68 4a 24 80 00       	push   $0x80244a
  801a2e:	ff 75 0c             	pushl  0xc(%ebp)
  801a31:	e8 dc ed ff ff       	call   800812 <strcpy>
	return 0;
}
  801a36:	b8 00 00 00 00       	mov    $0x0,%eax
  801a3b:	c9                   	leave  
  801a3c:	c3                   	ret    

00801a3d <devcons_write>:
{
  801a3d:	f3 0f 1e fb          	endbr32 
  801a41:	55                   	push   %ebp
  801a42:	89 e5                	mov    %esp,%ebp
  801a44:	57                   	push   %edi
  801a45:	56                   	push   %esi
  801a46:	53                   	push   %ebx
  801a47:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801a4d:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  801a52:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  801a58:	3b 75 10             	cmp    0x10(%ebp),%esi
  801a5b:	73 31                	jae    801a8e <devcons_write+0x51>
		m = n - tot;
  801a5d:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801a60:	29 f3                	sub    %esi,%ebx
  801a62:	83 fb 7f             	cmp    $0x7f,%ebx
  801a65:	b8 7f 00 00 00       	mov    $0x7f,%eax
  801a6a:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  801a6d:	83 ec 04             	sub    $0x4,%esp
  801a70:	53                   	push   %ebx
  801a71:	89 f0                	mov    %esi,%eax
  801a73:	03 45 0c             	add    0xc(%ebp),%eax
  801a76:	50                   	push   %eax
  801a77:	57                   	push   %edi
  801a78:	e8 4b ef ff ff       	call   8009c8 <memmove>
		sys_cputs(buf, m);
  801a7d:	83 c4 08             	add    $0x8,%esp
  801a80:	53                   	push   %ebx
  801a81:	57                   	push   %edi
  801a82:	e8 fd f0 ff ff       	call   800b84 <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  801a87:	01 de                	add    %ebx,%esi
  801a89:	83 c4 10             	add    $0x10,%esp
  801a8c:	eb ca                	jmp    801a58 <devcons_write+0x1b>
}
  801a8e:	89 f0                	mov    %esi,%eax
  801a90:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801a93:	5b                   	pop    %ebx
  801a94:	5e                   	pop    %esi
  801a95:	5f                   	pop    %edi
  801a96:	5d                   	pop    %ebp
  801a97:	c3                   	ret    

00801a98 <devcons_read>:
{
  801a98:	f3 0f 1e fb          	endbr32 
  801a9c:	55                   	push   %ebp
  801a9d:	89 e5                	mov    %esp,%ebp
  801a9f:	83 ec 08             	sub    $0x8,%esp
  801aa2:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  801aa7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  801aab:	74 21                	je     801ace <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  801aad:	e8 f4 f0 ff ff       	call   800ba6 <sys_cgetc>
  801ab2:	85 c0                	test   %eax,%eax
  801ab4:	75 07                	jne    801abd <devcons_read+0x25>
		sys_yield();
  801ab6:	e8 76 f1 ff ff       	call   800c31 <sys_yield>
  801abb:	eb f0                	jmp    801aad <devcons_read+0x15>
	if (c < 0)
  801abd:	78 0f                	js     801ace <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  801abf:	83 f8 04             	cmp    $0x4,%eax
  801ac2:	74 0c                	je     801ad0 <devcons_read+0x38>
	*(char*)vbuf = c;
  801ac4:	8b 55 0c             	mov    0xc(%ebp),%edx
  801ac7:	88 02                	mov    %al,(%edx)
	return 1;
  801ac9:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801ace:	c9                   	leave  
  801acf:	c3                   	ret    
		return 0;
  801ad0:	b8 00 00 00 00       	mov    $0x0,%eax
  801ad5:	eb f7                	jmp    801ace <devcons_read+0x36>

00801ad7 <cputchar>:
{
  801ad7:	f3 0f 1e fb          	endbr32 
  801adb:	55                   	push   %ebp
  801adc:	89 e5                	mov    %esp,%ebp
  801ade:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801ae1:	8b 45 08             	mov    0x8(%ebp),%eax
  801ae4:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801ae7:	6a 01                	push   $0x1
  801ae9:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801aec:	50                   	push   %eax
  801aed:	e8 92 f0 ff ff       	call   800b84 <sys_cputs>
}
  801af2:	83 c4 10             	add    $0x10,%esp
  801af5:	c9                   	leave  
  801af6:	c3                   	ret    

00801af7 <getchar>:
{
  801af7:	f3 0f 1e fb          	endbr32 
  801afb:	55                   	push   %ebp
  801afc:	89 e5                	mov    %esp,%ebp
  801afe:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801b01:	6a 01                	push   $0x1
  801b03:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801b06:	50                   	push   %eax
  801b07:	6a 00                	push   $0x0
  801b09:	e8 5f f6 ff ff       	call   80116d <read>
	if (r < 0)
  801b0e:	83 c4 10             	add    $0x10,%esp
  801b11:	85 c0                	test   %eax,%eax
  801b13:	78 06                	js     801b1b <getchar+0x24>
	if (r < 1)
  801b15:	74 06                	je     801b1d <getchar+0x26>
	return c;
  801b17:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801b1b:	c9                   	leave  
  801b1c:	c3                   	ret    
		return -E_EOF;
  801b1d:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801b22:	eb f7                	jmp    801b1b <getchar+0x24>

00801b24 <iscons>:
{
  801b24:	f3 0f 1e fb          	endbr32 
  801b28:	55                   	push   %ebp
  801b29:	89 e5                	mov    %esp,%ebp
  801b2b:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801b2e:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801b31:	50                   	push   %eax
  801b32:	ff 75 08             	pushl  0x8(%ebp)
  801b35:	e8 b0 f3 ff ff       	call   800eea <fd_lookup>
  801b3a:	83 c4 10             	add    $0x10,%esp
  801b3d:	85 c0                	test   %eax,%eax
  801b3f:	78 11                	js     801b52 <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801b41:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801b44:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801b4a:	39 10                	cmp    %edx,(%eax)
  801b4c:	0f 94 c0             	sete   %al
  801b4f:	0f b6 c0             	movzbl %al,%eax
}
  801b52:	c9                   	leave  
  801b53:	c3                   	ret    

00801b54 <opencons>:
{
  801b54:	f3 0f 1e fb          	endbr32 
  801b58:	55                   	push   %ebp
  801b59:	89 e5                	mov    %esp,%ebp
  801b5b:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801b5e:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801b61:	50                   	push   %eax
  801b62:	e8 2d f3 ff ff       	call   800e94 <fd_alloc>
  801b67:	83 c4 10             	add    $0x10,%esp
  801b6a:	85 c0                	test   %eax,%eax
  801b6c:	78 3a                	js     801ba8 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801b6e:	83 ec 04             	sub    $0x4,%esp
  801b71:	68 07 04 00 00       	push   $0x407
  801b76:	ff 75 f4             	pushl  -0xc(%ebp)
  801b79:	6a 00                	push   $0x0
  801b7b:	e8 d4 f0 ff ff       	call   800c54 <sys_page_alloc>
  801b80:	83 c4 10             	add    $0x10,%esp
  801b83:	85 c0                	test   %eax,%eax
  801b85:	78 21                	js     801ba8 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801b87:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801b8a:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801b90:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801b92:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801b95:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801b9c:	83 ec 0c             	sub    $0xc,%esp
  801b9f:	50                   	push   %eax
  801ba0:	e8 c0 f2 ff ff       	call   800e65 <fd2num>
  801ba5:	83 c4 10             	add    $0x10,%esp
}
  801ba8:	c9                   	leave  
  801ba9:	c3                   	ret    

00801baa <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801baa:	f3 0f 1e fb          	endbr32 
  801bae:	55                   	push   %ebp
  801baf:	89 e5                	mov    %esp,%ebp
  801bb1:	56                   	push   %esi
  801bb2:	53                   	push   %ebx
  801bb3:	8b 75 08             	mov    0x8(%ebp),%esi
  801bb6:	8b 45 0c             	mov    0xc(%ebp),%eax
  801bb9:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801bbc:	85 c0                	test   %eax,%eax
  801bbe:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801bc3:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801bc6:	83 ec 0c             	sub    $0xc,%esp
  801bc9:	50                   	push   %eax
  801bca:	e8 51 f2 ff ff       	call   800e20 <sys_ipc_recv>
  801bcf:	83 c4 10             	add    $0x10,%esp
  801bd2:	85 c0                	test   %eax,%eax
  801bd4:	78 3f                	js     801c15 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801bd6:	e8 33 f0 ff ff       	call   800c0e <sys_getenvid>
  801bdb:	25 ff 03 00 00       	and    $0x3ff,%eax
  801be0:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801be3:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801be9:	89 15 20 40 c0 00    	mov    %edx,0xc04020

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801bef:	85 f6                	test   %esi,%esi
  801bf1:	74 05                	je     801bf8 <ipc_recv+0x4e>
  801bf3:	8b 42 74             	mov    0x74(%edx),%eax
  801bf6:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801bf8:	85 db                	test   %ebx,%ebx
  801bfa:	74 0a                	je     801c06 <ipc_recv+0x5c>
  801bfc:	a1 20 40 c0 00       	mov    0xc04020,%eax
  801c01:	8b 40 78             	mov    0x78(%eax),%eax
  801c04:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801c06:	a1 20 40 c0 00       	mov    0xc04020,%eax
  801c0b:	8b 40 70             	mov    0x70(%eax),%eax
}
  801c0e:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801c11:	5b                   	pop    %ebx
  801c12:	5e                   	pop    %esi
  801c13:	5d                   	pop    %ebp
  801c14:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801c15:	85 f6                	test   %esi,%esi
  801c17:	74 06                	je     801c1f <ipc_recv+0x75>
  801c19:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801c1f:	85 db                	test   %ebx,%ebx
  801c21:	74 eb                	je     801c0e <ipc_recv+0x64>
  801c23:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801c29:	eb e3                	jmp    801c0e <ipc_recv+0x64>

00801c2b <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801c2b:	f3 0f 1e fb          	endbr32 
  801c2f:	55                   	push   %ebp
  801c30:	89 e5                	mov    %esp,%ebp
  801c32:	57                   	push   %edi
  801c33:	56                   	push   %esi
  801c34:	53                   	push   %ebx
  801c35:	83 ec 0c             	sub    $0xc,%esp
  801c38:	8b 7d 08             	mov    0x8(%ebp),%edi
  801c3b:	8b 75 0c             	mov    0xc(%ebp),%esi
  801c3e:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801c41:	85 db                	test   %ebx,%ebx
  801c43:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801c48:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801c4b:	ff 75 14             	pushl  0x14(%ebp)
  801c4e:	53                   	push   %ebx
  801c4f:	56                   	push   %esi
  801c50:	57                   	push   %edi
  801c51:	e8 a3 f1 ff ff       	call   800df9 <sys_ipc_try_send>
  801c56:	83 c4 10             	add    $0x10,%esp
  801c59:	85 c0                	test   %eax,%eax
  801c5b:	79 1e                	jns    801c7b <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801c5d:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801c60:	75 07                	jne    801c69 <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801c62:	e8 ca ef ff ff       	call   800c31 <sys_yield>
  801c67:	eb e2                	jmp    801c4b <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801c69:	50                   	push   %eax
  801c6a:	68 56 24 80 00       	push   $0x802456
  801c6f:	6a 3b                	push   $0x3b
  801c71:	68 6a 24 80 00       	push   $0x80246a
  801c76:	e8 d7 e4 ff ff       	call   800152 <_panic>
	}
}
  801c7b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c7e:	5b                   	pop    %ebx
  801c7f:	5e                   	pop    %esi
  801c80:	5f                   	pop    %edi
  801c81:	5d                   	pop    %ebp
  801c82:	c3                   	ret    

00801c83 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801c83:	f3 0f 1e fb          	endbr32 
  801c87:	55                   	push   %ebp
  801c88:	89 e5                	mov    %esp,%ebp
  801c8a:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801c8d:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801c92:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801c95:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801c9b:	8b 52 50             	mov    0x50(%edx),%edx
  801c9e:	39 ca                	cmp    %ecx,%edx
  801ca0:	74 11                	je     801cb3 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801ca2:	83 c0 01             	add    $0x1,%eax
  801ca5:	3d 00 04 00 00       	cmp    $0x400,%eax
  801caa:	75 e6                	jne    801c92 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801cac:	b8 00 00 00 00       	mov    $0x0,%eax
  801cb1:	eb 0b                	jmp    801cbe <ipc_find_env+0x3b>
			return envs[i].env_id;
  801cb3:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801cb6:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801cbb:	8b 40 48             	mov    0x48(%eax),%eax
}
  801cbe:	5d                   	pop    %ebp
  801cbf:	c3                   	ret    

00801cc0 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801cc0:	f3 0f 1e fb          	endbr32 
  801cc4:	55                   	push   %ebp
  801cc5:	89 e5                	mov    %esp,%ebp
  801cc7:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801cca:	89 c2                	mov    %eax,%edx
  801ccc:	c1 ea 16             	shr    $0x16,%edx
  801ccf:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801cd6:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801cdb:	f6 c1 01             	test   $0x1,%cl
  801cde:	74 1c                	je     801cfc <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801ce0:	c1 e8 0c             	shr    $0xc,%eax
  801ce3:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801cea:	a8 01                	test   $0x1,%al
  801cec:	74 0e                	je     801cfc <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801cee:	c1 e8 0c             	shr    $0xc,%eax
  801cf1:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801cf8:	ef 
  801cf9:	0f b7 d2             	movzwl %dx,%edx
}
  801cfc:	89 d0                	mov    %edx,%eax
  801cfe:	5d                   	pop    %ebp
  801cff:	c3                   	ret    

00801d00 <__udivdi3>:
  801d00:	f3 0f 1e fb          	endbr32 
  801d04:	55                   	push   %ebp
  801d05:	57                   	push   %edi
  801d06:	56                   	push   %esi
  801d07:	53                   	push   %ebx
  801d08:	83 ec 1c             	sub    $0x1c,%esp
  801d0b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801d0f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801d13:	8b 74 24 34          	mov    0x34(%esp),%esi
  801d17:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801d1b:	85 d2                	test   %edx,%edx
  801d1d:	75 19                	jne    801d38 <__udivdi3+0x38>
  801d1f:	39 f3                	cmp    %esi,%ebx
  801d21:	76 4d                	jbe    801d70 <__udivdi3+0x70>
  801d23:	31 ff                	xor    %edi,%edi
  801d25:	89 e8                	mov    %ebp,%eax
  801d27:	89 f2                	mov    %esi,%edx
  801d29:	f7 f3                	div    %ebx
  801d2b:	89 fa                	mov    %edi,%edx
  801d2d:	83 c4 1c             	add    $0x1c,%esp
  801d30:	5b                   	pop    %ebx
  801d31:	5e                   	pop    %esi
  801d32:	5f                   	pop    %edi
  801d33:	5d                   	pop    %ebp
  801d34:	c3                   	ret    
  801d35:	8d 76 00             	lea    0x0(%esi),%esi
  801d38:	39 f2                	cmp    %esi,%edx
  801d3a:	76 14                	jbe    801d50 <__udivdi3+0x50>
  801d3c:	31 ff                	xor    %edi,%edi
  801d3e:	31 c0                	xor    %eax,%eax
  801d40:	89 fa                	mov    %edi,%edx
  801d42:	83 c4 1c             	add    $0x1c,%esp
  801d45:	5b                   	pop    %ebx
  801d46:	5e                   	pop    %esi
  801d47:	5f                   	pop    %edi
  801d48:	5d                   	pop    %ebp
  801d49:	c3                   	ret    
  801d4a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801d50:	0f bd fa             	bsr    %edx,%edi
  801d53:	83 f7 1f             	xor    $0x1f,%edi
  801d56:	75 48                	jne    801da0 <__udivdi3+0xa0>
  801d58:	39 f2                	cmp    %esi,%edx
  801d5a:	72 06                	jb     801d62 <__udivdi3+0x62>
  801d5c:	31 c0                	xor    %eax,%eax
  801d5e:	39 eb                	cmp    %ebp,%ebx
  801d60:	77 de                	ja     801d40 <__udivdi3+0x40>
  801d62:	b8 01 00 00 00       	mov    $0x1,%eax
  801d67:	eb d7                	jmp    801d40 <__udivdi3+0x40>
  801d69:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d70:	89 d9                	mov    %ebx,%ecx
  801d72:	85 db                	test   %ebx,%ebx
  801d74:	75 0b                	jne    801d81 <__udivdi3+0x81>
  801d76:	b8 01 00 00 00       	mov    $0x1,%eax
  801d7b:	31 d2                	xor    %edx,%edx
  801d7d:	f7 f3                	div    %ebx
  801d7f:	89 c1                	mov    %eax,%ecx
  801d81:	31 d2                	xor    %edx,%edx
  801d83:	89 f0                	mov    %esi,%eax
  801d85:	f7 f1                	div    %ecx
  801d87:	89 c6                	mov    %eax,%esi
  801d89:	89 e8                	mov    %ebp,%eax
  801d8b:	89 f7                	mov    %esi,%edi
  801d8d:	f7 f1                	div    %ecx
  801d8f:	89 fa                	mov    %edi,%edx
  801d91:	83 c4 1c             	add    $0x1c,%esp
  801d94:	5b                   	pop    %ebx
  801d95:	5e                   	pop    %esi
  801d96:	5f                   	pop    %edi
  801d97:	5d                   	pop    %ebp
  801d98:	c3                   	ret    
  801d99:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801da0:	89 f9                	mov    %edi,%ecx
  801da2:	b8 20 00 00 00       	mov    $0x20,%eax
  801da7:	29 f8                	sub    %edi,%eax
  801da9:	d3 e2                	shl    %cl,%edx
  801dab:	89 54 24 08          	mov    %edx,0x8(%esp)
  801daf:	89 c1                	mov    %eax,%ecx
  801db1:	89 da                	mov    %ebx,%edx
  801db3:	d3 ea                	shr    %cl,%edx
  801db5:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801db9:	09 d1                	or     %edx,%ecx
  801dbb:	89 f2                	mov    %esi,%edx
  801dbd:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801dc1:	89 f9                	mov    %edi,%ecx
  801dc3:	d3 e3                	shl    %cl,%ebx
  801dc5:	89 c1                	mov    %eax,%ecx
  801dc7:	d3 ea                	shr    %cl,%edx
  801dc9:	89 f9                	mov    %edi,%ecx
  801dcb:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801dcf:	89 eb                	mov    %ebp,%ebx
  801dd1:	d3 e6                	shl    %cl,%esi
  801dd3:	89 c1                	mov    %eax,%ecx
  801dd5:	d3 eb                	shr    %cl,%ebx
  801dd7:	09 de                	or     %ebx,%esi
  801dd9:	89 f0                	mov    %esi,%eax
  801ddb:	f7 74 24 08          	divl   0x8(%esp)
  801ddf:	89 d6                	mov    %edx,%esi
  801de1:	89 c3                	mov    %eax,%ebx
  801de3:	f7 64 24 0c          	mull   0xc(%esp)
  801de7:	39 d6                	cmp    %edx,%esi
  801de9:	72 15                	jb     801e00 <__udivdi3+0x100>
  801deb:	89 f9                	mov    %edi,%ecx
  801ded:	d3 e5                	shl    %cl,%ebp
  801def:	39 c5                	cmp    %eax,%ebp
  801df1:	73 04                	jae    801df7 <__udivdi3+0xf7>
  801df3:	39 d6                	cmp    %edx,%esi
  801df5:	74 09                	je     801e00 <__udivdi3+0x100>
  801df7:	89 d8                	mov    %ebx,%eax
  801df9:	31 ff                	xor    %edi,%edi
  801dfb:	e9 40 ff ff ff       	jmp    801d40 <__udivdi3+0x40>
  801e00:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801e03:	31 ff                	xor    %edi,%edi
  801e05:	e9 36 ff ff ff       	jmp    801d40 <__udivdi3+0x40>
  801e0a:	66 90                	xchg   %ax,%ax
  801e0c:	66 90                	xchg   %ax,%ax
  801e0e:	66 90                	xchg   %ax,%ax

00801e10 <__umoddi3>:
  801e10:	f3 0f 1e fb          	endbr32 
  801e14:	55                   	push   %ebp
  801e15:	57                   	push   %edi
  801e16:	56                   	push   %esi
  801e17:	53                   	push   %ebx
  801e18:	83 ec 1c             	sub    $0x1c,%esp
  801e1b:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801e1f:	8b 74 24 30          	mov    0x30(%esp),%esi
  801e23:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801e27:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801e2b:	85 c0                	test   %eax,%eax
  801e2d:	75 19                	jne    801e48 <__umoddi3+0x38>
  801e2f:	39 df                	cmp    %ebx,%edi
  801e31:	76 5d                	jbe    801e90 <__umoddi3+0x80>
  801e33:	89 f0                	mov    %esi,%eax
  801e35:	89 da                	mov    %ebx,%edx
  801e37:	f7 f7                	div    %edi
  801e39:	89 d0                	mov    %edx,%eax
  801e3b:	31 d2                	xor    %edx,%edx
  801e3d:	83 c4 1c             	add    $0x1c,%esp
  801e40:	5b                   	pop    %ebx
  801e41:	5e                   	pop    %esi
  801e42:	5f                   	pop    %edi
  801e43:	5d                   	pop    %ebp
  801e44:	c3                   	ret    
  801e45:	8d 76 00             	lea    0x0(%esi),%esi
  801e48:	89 f2                	mov    %esi,%edx
  801e4a:	39 d8                	cmp    %ebx,%eax
  801e4c:	76 12                	jbe    801e60 <__umoddi3+0x50>
  801e4e:	89 f0                	mov    %esi,%eax
  801e50:	89 da                	mov    %ebx,%edx
  801e52:	83 c4 1c             	add    $0x1c,%esp
  801e55:	5b                   	pop    %ebx
  801e56:	5e                   	pop    %esi
  801e57:	5f                   	pop    %edi
  801e58:	5d                   	pop    %ebp
  801e59:	c3                   	ret    
  801e5a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801e60:	0f bd e8             	bsr    %eax,%ebp
  801e63:	83 f5 1f             	xor    $0x1f,%ebp
  801e66:	75 50                	jne    801eb8 <__umoddi3+0xa8>
  801e68:	39 d8                	cmp    %ebx,%eax
  801e6a:	0f 82 e0 00 00 00    	jb     801f50 <__umoddi3+0x140>
  801e70:	89 d9                	mov    %ebx,%ecx
  801e72:	39 f7                	cmp    %esi,%edi
  801e74:	0f 86 d6 00 00 00    	jbe    801f50 <__umoddi3+0x140>
  801e7a:	89 d0                	mov    %edx,%eax
  801e7c:	89 ca                	mov    %ecx,%edx
  801e7e:	83 c4 1c             	add    $0x1c,%esp
  801e81:	5b                   	pop    %ebx
  801e82:	5e                   	pop    %esi
  801e83:	5f                   	pop    %edi
  801e84:	5d                   	pop    %ebp
  801e85:	c3                   	ret    
  801e86:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e8d:	8d 76 00             	lea    0x0(%esi),%esi
  801e90:	89 fd                	mov    %edi,%ebp
  801e92:	85 ff                	test   %edi,%edi
  801e94:	75 0b                	jne    801ea1 <__umoddi3+0x91>
  801e96:	b8 01 00 00 00       	mov    $0x1,%eax
  801e9b:	31 d2                	xor    %edx,%edx
  801e9d:	f7 f7                	div    %edi
  801e9f:	89 c5                	mov    %eax,%ebp
  801ea1:	89 d8                	mov    %ebx,%eax
  801ea3:	31 d2                	xor    %edx,%edx
  801ea5:	f7 f5                	div    %ebp
  801ea7:	89 f0                	mov    %esi,%eax
  801ea9:	f7 f5                	div    %ebp
  801eab:	89 d0                	mov    %edx,%eax
  801ead:	31 d2                	xor    %edx,%edx
  801eaf:	eb 8c                	jmp    801e3d <__umoddi3+0x2d>
  801eb1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801eb8:	89 e9                	mov    %ebp,%ecx
  801eba:	ba 20 00 00 00       	mov    $0x20,%edx
  801ebf:	29 ea                	sub    %ebp,%edx
  801ec1:	d3 e0                	shl    %cl,%eax
  801ec3:	89 44 24 08          	mov    %eax,0x8(%esp)
  801ec7:	89 d1                	mov    %edx,%ecx
  801ec9:	89 f8                	mov    %edi,%eax
  801ecb:	d3 e8                	shr    %cl,%eax
  801ecd:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801ed1:	89 54 24 04          	mov    %edx,0x4(%esp)
  801ed5:	8b 54 24 04          	mov    0x4(%esp),%edx
  801ed9:	09 c1                	or     %eax,%ecx
  801edb:	89 d8                	mov    %ebx,%eax
  801edd:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801ee1:	89 e9                	mov    %ebp,%ecx
  801ee3:	d3 e7                	shl    %cl,%edi
  801ee5:	89 d1                	mov    %edx,%ecx
  801ee7:	d3 e8                	shr    %cl,%eax
  801ee9:	89 e9                	mov    %ebp,%ecx
  801eeb:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801eef:	d3 e3                	shl    %cl,%ebx
  801ef1:	89 c7                	mov    %eax,%edi
  801ef3:	89 d1                	mov    %edx,%ecx
  801ef5:	89 f0                	mov    %esi,%eax
  801ef7:	d3 e8                	shr    %cl,%eax
  801ef9:	89 e9                	mov    %ebp,%ecx
  801efb:	89 fa                	mov    %edi,%edx
  801efd:	d3 e6                	shl    %cl,%esi
  801eff:	09 d8                	or     %ebx,%eax
  801f01:	f7 74 24 08          	divl   0x8(%esp)
  801f05:	89 d1                	mov    %edx,%ecx
  801f07:	89 f3                	mov    %esi,%ebx
  801f09:	f7 64 24 0c          	mull   0xc(%esp)
  801f0d:	89 c6                	mov    %eax,%esi
  801f0f:	89 d7                	mov    %edx,%edi
  801f11:	39 d1                	cmp    %edx,%ecx
  801f13:	72 06                	jb     801f1b <__umoddi3+0x10b>
  801f15:	75 10                	jne    801f27 <__umoddi3+0x117>
  801f17:	39 c3                	cmp    %eax,%ebx
  801f19:	73 0c                	jae    801f27 <__umoddi3+0x117>
  801f1b:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801f1f:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801f23:	89 d7                	mov    %edx,%edi
  801f25:	89 c6                	mov    %eax,%esi
  801f27:	89 ca                	mov    %ecx,%edx
  801f29:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801f2e:	29 f3                	sub    %esi,%ebx
  801f30:	19 fa                	sbb    %edi,%edx
  801f32:	89 d0                	mov    %edx,%eax
  801f34:	d3 e0                	shl    %cl,%eax
  801f36:	89 e9                	mov    %ebp,%ecx
  801f38:	d3 eb                	shr    %cl,%ebx
  801f3a:	d3 ea                	shr    %cl,%edx
  801f3c:	09 d8                	or     %ebx,%eax
  801f3e:	83 c4 1c             	add    $0x1c,%esp
  801f41:	5b                   	pop    %ebx
  801f42:	5e                   	pop    %esi
  801f43:	5f                   	pop    %edi
  801f44:	5d                   	pop    %ebp
  801f45:	c3                   	ret    
  801f46:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801f4d:	8d 76 00             	lea    0x0(%esi),%esi
  801f50:	29 fe                	sub    %edi,%esi
  801f52:	19 c3                	sbb    %eax,%ebx
  801f54:	89 f2                	mov    %esi,%edx
  801f56:	89 d9                	mov    %ebx,%ecx
  801f58:	e9 1d ff ff ff       	jmp    801e7a <__umoddi3+0x6a>
